Fixed an issue adding files to a new project.

Fri, 20 May 2011 19:07:30 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 20 May 2011 19:07:30 +0200
changeset 1044
11aca34cce20
parent 1042
f6efc93ff22a
child 1046
5dd14be5d6a1

Fixed an issue adding files to a new project.

Project/Project.py file | annotate | diff | comparison | revisions
--- a/Project/Project.py	Fri May 20 18:44:36 2011 +0200
+++ b/Project/Project.py	Fri May 20 19:07:30 2011 +0200
@@ -2066,21 +2066,16 @@
                                 "(use '%language%' in place of the language code):"),
                     QLineEdit.Normal,
                     tslist[0])
-                if not pattern.isEmpty:
+                if pattern:
                     self.pdata["TRANSLATIONPATTERN"] = [pattern]
-            self.pdata["TRANSLATIONPATTERN"][0] = \
-                self.getRelativePath(self.pdata["TRANSLATIONPATTERN"][0])
-            pattern = self.pdata["TRANSLATIONPATTERN"][0].replace("%language%", "*")
-            for ts in tslist:
-                if fnmatch.fnmatch(ts, pattern):
-                    self.pdata["TRANSLATIONS"].append(ts)
-                    self.projectLanguageAdded.emit(ts)
-            if len(self.pdata["MAINSCRIPT"]) == 0 or \
-               len(self.pdata["MAINSCRIPT"][0]) == 0:
-                if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]:
-                    self.pdata["MAINSCRIPT"] = ['{0}.py'.format(mainscriptname)]
-                elif self.pdata["PROGLANGUAGE"][0] == "Ruby":
-                    self.pdata["MAINSCRIPT"] = ['{0}.rb'.format(mainscriptname)]
+            if self.pdata["TRANSLATIONPATTERN"]:
+                self.pdata["TRANSLATIONPATTERN"][0] = \
+                    self.getRelativePath(self.pdata["TRANSLATIONPATTERN"][0])
+                pattern = self.pdata["TRANSLATIONPATTERN"][0].replace("%language%", "*")
+                for ts in tslist:
+                    if fnmatch.fnmatch(ts, pattern):
+                        self.pdata["TRANSLATIONS"].append(ts)
+                        self.projectLanguageAdded.emit(ts)
             if self.pdata["TRANSLATIONSBINPATH"]:
                 tpd = os.path.join(self.ppath,
                                    self.pdata["TRANSLATIONSBINPATH"][0])
@@ -2091,6 +2086,12 @@
                 for qm in qmlist:
                     self.pdata["TRANSLATIONS"].append(qm)
                     self.projectLanguageAdded.emit(qm)
+            if len(self.pdata["MAINSCRIPT"]) == 0 or \
+               len(self.pdata["MAINSCRIPT"][0]) == 0:
+                if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]:
+                    self.pdata["MAINSCRIPT"] = ['{0}.py'.format(mainscriptname)]
+                elif self.pdata["PROGLANGUAGE"][0] == "Ruby":
+                    self.pdata["MAINSCRIPT"] = ['{0}.rb'.format(mainscriptname)]
         self.setDirty(True)
         QApplication.restoreOverrideCursor()
     

eric ide

mercurial