Project/ProjectTranslationsBrowser.py

changeset 5599
033967644b1f
parent 5389
9b1c800daff3
child 5624
cdd346d8858b
--- a/Project/ProjectTranslationsBrowser.py	Thu Mar 09 19:28:59 2017 +0100
+++ b/Project/ProjectTranslationsBrowser.py	Fri Mar 10 17:32:19 2017 +0100
@@ -10,7 +10,7 @@
 
 from __future__ import unicode_literals
 try:
-    str = unicode
+    str = unicode   # __IGNORE_WARNING_M131__
 except NameError:
     pass
 
@@ -731,7 +731,7 @@
     ##  Methods to support the generation and release commands
     ###########################################################################
     
-    def __writeTempProjectFile(self, langs, filter):
+    def __writeTempProjectFile(self, langs, filterList):
         """
         Private method to write a temporary project file suitable for
         pylupdate and lrelease.
@@ -739,8 +739,8 @@
         @param langs list of languages to include in the process. An empty
             list (default) means that all translations should be included.
             (list of ProjectBrowserFileItem)
-        @param filter list of source file extension that should be considered
-            (list of strings)
+        @param filterList list of source file extension that should be
+            considered (list of strings)
         @return flag indicating success
         """
         path, ext = os.path.splitext(self.project.pfile)
@@ -748,7 +748,7 @@
         
         # only consider files satisfying the filter criteria
         _sources = [s for s in self.project.pdata["SOURCES"]
-                    if os.path.splitext(s)[1] in filter]
+                    if os.path.splitext(s)[1] in filterList]
         sources = []
         for s in _sources:
             addIt = True
@@ -808,28 +808,29 @@
                 ("TRANSLATIONS",
                  [prefix + lang for lang in langs]))
             
-            dir, name = os.path.split(pfile)
-            outFile = os.path.join(dir, os.path.dirname(langs[0]), name)
+            directory, name = os.path.split(pfile)
+            outFile = os.path.join(directory, os.path.dirname(langs[0]), name)
             outDir = os.path.dirname(outFile)
             if not os.path.exists(outDir):
                 os.makedirs(outDir)
             try:
                 pf = open(outFile, "w", encoding="utf-8")
-                for key, list in sections:
-                    if len(list) > 0:
+                for key, fileList in sections:
+                    if len(fileList) > 0:
                         pf.write('{0} = '.format(key))
-                        last = len(list) - 1
+                        last = len(fileList) - 1
                         if last > 0:
                             pf.write('{0} \\{1}'.format(
-                                list[0].replace(os.sep, '/'), "\n"))
+                                fileList[0].replace(os.sep, '/'), "\n"))
                             for i in range(1, last):
                                 pf.write('\t{0} \\{1}'.format(
-                                    list[i].replace(os.sep, '/'), "\n"))
+                                    fileList[i].replace(os.sep, '/'), "\n"))
                             pf.write('\t{0} {1}{2}'.format(
-                                list[last].replace(os.sep, '/'), "\n", "\n"))
+                                fileList[last].replace(os.sep, '/'),
+                                "\n", "\n"))
                         else:
                             pf.write('{0} {1}{2}'.format(
-                                list[0].replace(os.sep, '/'), "\n", "\n"))
+                                fileList[0].replace(os.sep, '/'), "\n", "\n"))
                     
                 pf.close()
                 self.__tmpProjects.append(outFile)

eric ide

mercurial