Project/Project.py

changeset 3010
befeff46ec0f
parent 2995
63d874899b8b
child 3020
542e97d4ecb3
child 3057
10516539f238
equal deleted inserted replaced
3009:bf5ae5d7477d 3010:befeff46ec0f
3868 ns.startswith('_'): 3868 ns.startswith('_'):
3869 # dot net hack 3869 # dot net hack
3870 continue 3870 continue
3871 3871
3872 # set fn to project relative name 3872 # set fn to project relative name
3873 # then reset ns to fully qualified name for insertion, possibly. 3873 # then reset ns to fully qualified name for insertion,
3874 # possibly.
3874 if dir == "": 3875 if dir == "":
3875 fn = ns 3876 fn = ns
3876 else: 3877 else:
3877 fn = os.path.join(dir, ns) 3878 fn = os.path.join(dir, ns)
3878 ns = os.path.abspath(os.path.join(curpath, ns)) 3879 ns = os.path.abspath(os.path.join(curpath, ns))
3885 dirs.append(d) 3886 dirs.append(d)
3886 continue 3887 continue
3887 3888
3888 filetype = "" 3889 filetype = ""
3889 bfn = os.path.basename(fn) 3890 bfn = os.path.basename(fn)
3890 for pattern in reversed(sorted(self.pdata["FILETYPES"].keys())): 3891 for pattern in reversed(
3892 sorted(self.pdata["FILETYPES"].keys())):
3891 if fnmatch.fnmatch(bfn, pattern): 3893 if fnmatch.fnmatch(bfn, pattern):
3892 filetype = self.pdata["FILETYPES"][pattern] 3894 filetype = self.pdata["FILETYPES"][pattern]
3893 break 3895 break
3894 3896
3895 if (filetype == "SOURCES" and 3897 if (filetype == "SOURCES" and
4056 # override failed, revert to original 4058 # override failed, revert to original
4057 QApplication.restoreOverrideCursor() 4059 QApplication.restoreOverrideCursor()
4058 E5MessageBox.critical(self.ui, 4060 E5MessageBox.critical(self.ui,
4059 self.trUtf8("Version Control System"), 4061 self.trUtf8("Version Control System"),
4060 self.trUtf8( 4062 self.trUtf8(
4061 "<p>The selected VCS <b>{0}</b> could not be found." 4063 "<p>The selected VCS <b>{0}</b> could not be"
4062 "<br/>Reverting override.</p><p>{1}</p>")\ 4064 " found. <br/>Reverting override.</p><p>{1}</p>")
4063 .format(vcsSystem, msg)) 4065 .format(vcsSystem, msg))
4064 self.pudata["VCSOVERRIDE"] = [] 4066 self.pudata["VCSOVERRIDE"] = []
4065 return self.initVCS(nooverride=True) 4067 return self.initVCS(nooverride=True)
4066 4068
4067 QApplication.restoreOverrideCursor() 4069 QApplication.restoreOverrideCursor()
4638 sourcelines = Utilities.readEncodedFile(filename)[0] 4640 sourcelines = Utilities.readEncodedFile(filename)[0]
4639 sourcelines = sourcelines.splitlines(True) 4641 sourcelines = sourcelines.splitlines(True)
4640 except (IOError, UnicodeError) as why: 4642 except (IOError, UnicodeError) as why:
4641 E5MessageBox.critical(self.ui, 4643 E5MessageBox.critical(self.ui,
4642 self.trUtf8("Create Plugin Archive"), 4644 self.trUtf8("Create Plugin Archive"),
4643 self.trUtf8("""<p>The plugin file <b>{0}</b> could """ 4645 self.trUtf8(
4644 """not be read.</p>""" 4646 """<p>The plugin file <b>{0}</b> could """
4645 """<p>Reason: {1}</p>""").format(filename, str(why))) 4647 """not be read.</p> <p>Reason: {1}</p>""")
4648 .format(filename, str(why)))
4646 return "" 4649 return ""
4647 4650
4648 for sourceline in sourcelines: 4651 for sourceline in sourcelines:
4649 if sourceline.startswith("version = "): 4652 if sourceline.startswith("version = "):
4650 version = sourceline.replace("version = ", "").strip()\ 4653 version = sourceline.replace("version = ", "").strip()\

eric ide

mercurial