--- a/src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py Tue Oct 25 17:25:51 2022 +0200 +++ b/src/eric7/Plugins/WizardPlugins/EricPluginWizard/Templates.py Wed Oct 26 11:50:03 2022 +0200 @@ -37,7 +37,7 @@ # End-Of-Header error = "" - + {modulesetup}\ {exeData}\ @@ -48,29 +48,30 @@ """ Class documentation goes here. """ + {config2}\ def __init__(self, ui): """ Constructor - + @param ui reference to the user interface object @type UI.UserInterface """ super({className}, self).__init__(ui) self.__ui = ui - + def activate(self): """ Public method to activate this plug-in. - + @return tuple of None and activation status @rtype bool """ global error - error = "" # clear previous error - + error = "" # clear previous error + return None, True - + def deactivate(self): """ Public method to deactivate this plug-in. @@ -85,13 +86,18 @@ configTemplate1 = '''def getConfigData(): """ Module function returning data as required by the configuration dialog. - + @return dictionary containing the relevant data @rtype dict """ return {{ - "<unique key>": ["<display string>", "<pixmap filename>", - pageCreationFunction, None, None], + "<unique key>": [ + "<display string>", + "<pixmap filename>", + pageCreationFunction, + None, + None, + ], }} @@ -105,26 +111,25 @@ ''' configTemplate2 = """ PreferencesKey = "{preferencesKey}" - + """ -configTemplate3 = '''\ - +configTemplate3 = ''' def getPreferences(self, key): """ Public method to retrieve the various settings values. - + @param key the key of the value to get @type str @return the requested setting value @rtype any """ return None - + def setPreferences(self, key, value): """ Public method to store the various settings values. - + @param key the key of the setting to be set @type str @param value the value to be set @@ -140,22 +145,22 @@ previewPixmapTemplate = '''def previewPix(): """ Module function to return a preview pixmap. - + @return preview pixmap @rtype QPixmap """ from PyQt6.QtGui import QPixmap - + fname = "preview.png" return QPixmap(fname) - + ''' exeDisplayDataListTemplate = '''def exeDisplayDataList(): """ Module function to support the display of some executable info. - + @return list of dictionaries containing the data to query the presence of the executable @rtype list of dict @@ -185,7 +190,7 @@ exeDisplayDataTemplate = '''def exeDisplayData(): """ Module function to support the display of some executable info. - + @return dictionary containing the data to query the presence of the executable @rtype dict @@ -202,7 +207,7 @@ "versionCleanup": None, "exeModule": None, } - + return data @@ -211,7 +216,7 @@ exeDisplayDataInfoTemplate = '''def exeDisplayData(): """ Module function to support the display of some executable info. - + @return dictionary containing the data to be shown @rtype dict """ @@ -221,7 +226,7 @@ "text": "<translated entry string>", "version": "", } - + return data @@ -239,19 +244,17 @@ apiFilesTemplate = '''def apiFiles(language): """ Module function to return the API files made available by this plug-in. - + @param language language to get APIs for @type str @return list of API filenames @rtype list of str """ - if language in ["Python3", "Python"]: - apisDir = os.path.join( - os.path.dirname(__file__), "APIs", "Python") - apis = glob.glob(os.path.join(apisDir, '*.api')) - apisDir = os.path.join( - os.path.dirname(__file__), "APIs", "Python3") - apis.extend(glob.glob(os.path.join(apisDir, '*.api'))) + if language in ("Python3", "Python"): + apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python") + apis = glob.glob(os.path.join(apisDir, "*.api")) + apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python3") + apis.extend(glob.glob(os.path.join(apisDir, "*.api"))) else: apis = [] return apis