Project/ProjectResourcesBrowser.py

changeset 1676
54f387117fee
parent 1509
c0b5e693b0eb
child 2192
61b3849df76d
child 2303
0ed4ed026c16
equal deleted inserted replaced
1674:7eb92d0bc124 1676:54f387117fee
707 buf = f.read() 707 buf = f.read()
708 f.close() 708 f.close()
709 except IOError: 709 except IOError:
710 return False 710 return False
711 711
712 qrcDirName = os.path.dirname(filename)
712 lbuf = "" 713 lbuf = ""
713 for line in buf.splitlines(): 714 for line in buf.splitlines():
714 line = line.strip() 715 line = line.strip()
715 if line.lower().startswith("<file>") or line.lower().startswith("<file "): 716 if line.lower().startswith("<file>") or line.lower().startswith("<file "):
716 lbuf = line 717 lbuf = line
717 elif lbuf: 718 elif lbuf:
718 lbuf = "{0}{1}".format(lbuf, line) 719 lbuf = "{0}{1}".format(lbuf, line)
719 if lbuf.lower().endswith("</file>"): 720 if lbuf.lower().endswith("</file>"):
720 rfile = lbuf.split(">", 1)[1].split("<", 1)[0] 721 rfile = lbuf.split(">", 1)[1].split("<", 1)[0]
721 if not os.path.isabs(rfile): 722 if not os.path.isabs(rfile):
722 rfile = os.path.join(self.project.ppath, rfile) 723 rfile = os.path.join(qrcDirName, rfile)
723 if os.path.exists(rfile) and \ 724 if os.path.exists(rfile) and \
724 os.stat(rfile).st_mtime > mtime: 725 os.stat(rfile).st_mtime > mtime:
725 return True 726 return True
726 727
727 lbuf = "" 728 lbuf = ""

eric ide

mercurial