--- a/Preferences/ProgramsDialog.py Fri Mar 11 08:55:14 2011 +0100 +++ b/Preferences/ProgramsDialog.py Fri Mar 11 16:51:57 2011 +0100 @@ -26,7 +26,7 @@ """ Class implementing the Programs page. """ - def __init__(self, parent = None): + def __init__(self, parent=None): """ Constructor @@ -79,60 +79,60 @@ exe = Utilities.isWindowsPlatform() and \ "{0}.exe".format(Utilities.generateQtToolName("lrelease")) or \ Utilities.generateQtToolName("lrelease") - version = self.__createProgramEntry(self.trUtf8("Translation Converter (Qt4)"), + version = self.__createProgramEntry(self.trUtf8("Translation Converter (Qt4)"), exe, '-version', 'lrelease', -1) # 1b. Qt4 Designer exe = Utilities.isWindowsPlatform() and \ "{0}.exe".format(Utilities.generateQtToolName("designer")) or \ Utilities.generateQtToolName("designer") - self.__createProgramEntry(self.trUtf8("Qt4 Designer"), exe, version = version) + self.__createProgramEntry(self.trUtf8("Qt4 Designer"), exe, version=version) # 1c. Qt4 Linguist exe = Utilities.isWindowsPlatform() and \ "{0}.exe".format(Utilities.generateQtToolName("linguist")) or \ Utilities.generateQtToolName("linguist") - self.__createProgramEntry(self.trUtf8("Qt4 Linguist"), exe, version = version) + self.__createProgramEntry(self.trUtf8("Qt4 Linguist"), exe, version=version) # 1d. Qt4 Assistant exe = Utilities.isWindowsPlatform() and \ "{0}.exe".format(Utilities.generateQtToolName("assistant")) or \ Utilities.generateQtToolName("assistant") - self.__createProgramEntry(self.trUtf8("Qt4 Assistant"), exe, version = version) + self.__createProgramEntry(self.trUtf8("Qt4 Assistant"), exe, version=version) # 2. do the PyQt programs # 2a. Translation Extractor PyQt4 - self.__createProgramEntry(self.trUtf8("Translation Extractor (Python, Qt4)"), - Utilities.isWindowsPlatform() and "pylupdate4.exe" or "pylupdate4", + self.__createProgramEntry(self.trUtf8("Translation Extractor (Python, Qt4)"), + Utilities.isWindowsPlatform() and "pylupdate4.exe" or "pylupdate4", '-version', 'pylupdate', -1) # 2b. Forms Compiler PyQt4 - self.__createProgramEntry(self.trUtf8("Forms Compiler (Python, Qt4)"), - Utilities.isWindowsPlatform() and "pyuic4.bat" or "pyuic4", + self.__createProgramEntry(self.trUtf8("Forms Compiler (Python, Qt4)"), + Utilities.isWindowsPlatform() and "pyuic4.bat" or "pyuic4", '--version', 'Python User', 4) # 2c. Resource Compiler PyQt4 - self.__createProgramEntry(self.trUtf8("Resource Compiler (Python, Qt4)"), - Utilities.isWindowsPlatform() and "pyrcc4.exe" or "pyrcc4", + self.__createProgramEntry(self.trUtf8("Resource Compiler (Python, Qt4)"), + Utilities.isWindowsPlatform() and "pyrcc4.exe" or "pyrcc4", '-version', 'Resource Compiler', -1) # 3. do the PySide programs # 3a. Translation Extractor PySide - self.__createProgramEntry(self.trUtf8("Translation Extractor (Python, PySide)"), - Utilities.isWindowsPlatform() and "pyside-lupdate.exe" or "pyside-lupdate", - '-version', '', -1, versionRe = 'lupdate') + self.__createProgramEntry(self.trUtf8("Translation Extractor (Python, PySide)"), + Utilities.isWindowsPlatform() and "pyside-lupdate.exe" or "pyside-lupdate", + '-version', '', -1, versionRe='lupdate') # 3b. Forms Compiler PySide - self.__createProgramEntry(self.trUtf8("Forms Compiler (Python, PySide)"), - Utilities.isWindowsPlatform() and "pyside-uic.bat" or "pyside-uic", + self.__createProgramEntry(self.trUtf8("Forms Compiler (Python, PySide)"), + Utilities.isWindowsPlatform() and "pyside-uic.bat" or "pyside-uic", '--version', 'Python User', 4) # 3.c Resource Compiler PySide - self.__createProgramEntry(self.trUtf8("Resource Compiler (Python, PySide)"), - Utilities.isWindowsPlatform() and "pyside-rcc4.exe" or "pyside-rcc4", + self.__createProgramEntry(self.trUtf8("Resource Compiler (Python, PySide)"), + Utilities.isWindowsPlatform() and "pyside-rcc4.exe" or "pyside-rcc4", '-version', 'Resource Compiler', -1) # 4. do the Ruby programs # 4a. Forms Compiler for Qt4 - self.__createProgramEntry(self.trUtf8("Forms Compiler (Ruby, Qt4)"), - Utilities.isWindowsPlatform() and "rbuic4.exe" or "rbuic4", + self.__createProgramEntry(self.trUtf8("Forms Compiler (Ruby, Qt4)"), + Utilities.isWindowsPlatform() and "rbuic4.exe" or "rbuic4", '-version', 'Qt', -1) # 4b. Resource Compiler for Qt4 - self.__createProgramEntry(self.trUtf8("Resource Compiler (Ruby, Qt4)"), - Utilities.isWindowsPlatform() and "rbrcc.exe" or "rbrcc", + self.__createProgramEntry(self.trUtf8("Resource Compiler (Ruby, Qt4)"), + Utilities.isWindowsPlatform() and "rbrcc.exe" or "rbrcc", '-version', 'Ruby Resource Compiler', -1) # 5. do the CORBA programs @@ -180,18 +180,18 @@ for info in pm.getPluginExeDisplayData(): if info["programEntry"]: self.__createProgramEntry( - info["header"], - info["exe"], - versionCommand = info["versionCommand"], - versionStartsWith = info["versionStartsWith"], - versionPosition = info["versionPosition"], - version = info["version"], - versionCleanup = info["versionCleanup"], + info["header"], + info["exe"], + versionCommand=info["versionCommand"], + versionStartsWith=info["versionStartsWith"], + versionPosition=info["versionPosition"], + version=info["version"], + versionCleanup=info["versionCleanup"], ) else: self.__createEntry( - info["header"], - info["text"], + info["header"], + info["text"], info["version"] ) @@ -201,9 +201,9 @@ self.__hasSearched = True def __createProgramEntry(self, description, exe, - versionCommand = "", versionStartsWith = "", - versionPosition = 0, version = "", - versionCleanup = None, versionRe = None): + versionCommand="", versionStartsWith="", + versionPosition=0, version="", + versionCleanup=None, versionRe=None): """ Private method to generate a program entry. @@ -216,7 +216,7 @@ @keyparam version version string to show (string) @keyparam versionCleanup tuple of two integers giving string positions start and stop for the version string (tuple of integers) - @keyparam versionRe regexp to determine the line identifying version + @keyparam versionRe regexp to determine the line identifying version info (string). Takes precedence over versionStartsWith. @return version string of detected or given version (string) """ @@ -247,8 +247,8 @@ finished = proc.waitForFinished(10000) if finished: output = \ - str(proc.readAllStandardOutput(), - Preferences.getSystem("IOEncoding"), + str(proc.readAllStandardOutput(), + Preferences.getSystem("IOEncoding"), 'replace') if versionRe is None: versionRe = "^{0}".format(re.escape(versionStartsWith))