ProjectPyramid/Project.py

changeset 106
2086bda4a893
parent 104
3e34b23890af
child 112
916727bdff4d
--- a/ProjectPyramid/Project.py	Fri Jan 20 19:06:31 2017 +0100
+++ b/ProjectPyramid/Project.py	Tue Mar 28 19:30:36 2017 +0200
@@ -47,7 +47,7 @@
     """
     Class transforming the call arguments in case of gnome-terminal.
     """
-    def start(self, cmd, args=[], mode=QProcessPyQt.ReadWrite):
+    def start(self, cmd, args=None, mode=QProcessPyQt.ReadWrite):
         """
         Public method to start the given program (cmd) in a new process, if
         none is already running, passing the command line arguments in args.
@@ -56,6 +56,9 @@
         @keyparam args list of parameters (list of strings)
         @keyparam mode access mode (QIODevice.OpenMode)
         """
+        if args is None:
+            args = []
+        
         if cmd.endswith(('gnome-terminal', 'konsole', 'xfce4-terminal',
                          'mate-terminal')):
             if '-e' in args:
@@ -66,7 +69,7 @@
         super(QProcess, self).start(cmd, args, mode)
     
     @staticmethod
-    def startDetached(cmd, args=[], path=''):
+    def startDetached(cmd, args=None, path=''):
         """
         Public static method to start the given program (cmd) in a new process,
         if none is already running, passing the command line arguments in args.
@@ -76,6 +79,9 @@
         @keyparam path new working directory (string)
         @return tuple of successful start and process id (boolean, integer)
         """
+        if args is None:
+            args = []
+        
         if cmd.endswith(('gnome-terminal', 'konsole', 'xfce4-terminal',
                          'mate-terminal')):
             if '-e' in args:
@@ -500,7 +506,7 @@
         if dlg.exec_() == QDialog.Accepted:
             template = dlg.getTemplateText()
             
-            filter = self.tr(
+            fileFilters = self.tr(
                 "Chameleon Templates (*.pt);;"
                 "Chameleon Text Templates (*.txt);;"
                 "Mako Templates (*.mako);;"
@@ -512,7 +518,7 @@
                 self.__ui,
                 self.tr("New Form"),
                 path,
-                filter,
+                fileFilters,
                 None,
                 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
             if fname:
@@ -589,8 +595,8 @@
         # environment variable not defined
         if path is not None:
             dirs = path.split(os.pathsep)
-            for dir in dirs:
-                exe = os.path.join(dir, file)
+            for directory in dirs:
+                exe = os.path.join(directory, file)
                 if os.access(exe, os.X_OK) and exe not in paths:
                     paths.append(exe)
         

eric ide

mercurial