Fixed an issue in Project.py causing the main script name being overwritten whenn adding files to a new project. 5_0_x

Sun, 25 Jul 2010 10:22:05 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 25 Jul 2010 10:22:05 +0200
branch
5_0_x
changeset 402
2cd7333e0202
parent 400
8601082da32e
child 403
c5bd65142984

Fixed an issue in Project.py causing the main script name being overwritten whenn adding files to a new project.

.issues/.properties file | annotate | diff | comparison | revisions
Project/Project.py file | annotate | diff | comparison | revisions
--- a/.issues/.properties	Sat Jul 24 18:31:18 2010 +0200
+++ b/.issues/.properties	Sun Jul 25 10:22:05 2010 +0200
@@ -1,19 +1,19 @@
-[Category]
-
-[State]
-new = 
-assigned = 
-investigating = 
-scheduled = 
-testing = 
-closed = 
-
-[Resolution]
-fixed = 
-rejected = 
-duplicate = 
-cannot reproduce = 
-
-[Assigned-To]
-detlev = 
-
+[Category]
+
+[State]
+new = 
+assigned = 
+investigating = 
+scheduled = 
+testing = 
+closed = 
+
+[Resolution]
+fixed = 
+rejected = 
+duplicate = 
+cannot reproduce = 
+
+[Assigned-To]
+detlev = 
+
--- a/Project/Project.py	Sat Jul 24 18:31:18 2010 +0200
+++ b/Project/Project.py	Sun Jul 25 10:22:05 2010 +0200
@@ -2541,10 +2541,12 @@
                 if fnmatch.fnmatch(ts, pattern):
                     self.pdata["TRANSLATIONS"].append(ts)
                     self.emit(SIGNAL('projectLanguageAdded'), ts)
-            if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python3"]:
-                self.pdata["MAINSCRIPT"] = ['%s.py' % mainscriptname]
-            elif self.pdata["PROGLANGUAGE"][0] == "Ruby":
-                self.pdata["MAINSCRIPT"] = ['%s.rb' % mainscriptname]
+            if len(self.pdata["MAINSCRIPT"]) == 0 or \
+               len(self.pdata["MAINSCRIPT"][0]) == 0:
+                if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python3"]:
+                    self.pdata["MAINSCRIPT"] = ['%s.py' % mainscriptname]
+                elif self.pdata["PROGLANGUAGE"][0] == "Ruby":
+                    self.pdata["MAINSCRIPT"] = ['%s.rb' % mainscriptname]
             if self.pdata["TRANSLATIONSBINPATH"]:
                 tpd = os.path.join(self.ppath, 
                                    self.pdata["TRANSLATIONSBINPATH"][0])

eric ide

mercurial