- implemented some code simplifications release-1.3.0

Sat, 24 Apr 2021 11:30:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 24 Apr 2021 11:30:11 +0200
changeset 61
fe1e8783a95f
parent 60
02243723ac17
child 62
14e7466907fe

- implemented some code simplifications

ChangeLog file | annotate | diff | comparison | revisions
PluginFlask.epj file | annotate | diff | comparison | revisions
PluginProjectFlask.py file | annotate | diff | comparison | revisions
PluginProjectFlask.zip file | annotate | diff | comparison | revisions
ProjectFlask/ConfigurationPage/FlaskPage.py file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.PluginProjectFlask.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.AnsiTools.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelCommandDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelConfigDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelProjectExtension.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskCommandDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskConfigDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskMigrateExtension.MigrateConfigDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskMigrateExtension.MigrateProjectExtension.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskVirtualenvConfigurationDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FormSelectionDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.Project.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.RoutesDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.RunServerDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.ServerStartOptionsDialog.html file | annotate | diff | comparison | revisions
ProjectFlask/FlaskBabelExtension/PyBabelCommandDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskBabelExtension/PyBabelConfigDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskBabelExtension/PyBabelProjectExtension.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskCommandDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskConfigDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskMigrateExtension/MigrateConfigDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskMigrateExtension/MigrateProjectExtension.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskMigrateExtension/MigrateSummaryDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FlaskVirtualenvConfigurationDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/FormSelectionDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/Project.py file | annotate | diff | comparison | revisions
ProjectFlask/RoutesDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/RunServerDialog.py file | annotate | diff | comparison | revisions
ProjectFlask/ServerStartOptionsDialog.py file | annotate | diff | comparison | revisions
--- a/ChangeLog	Wed Dec 30 11:02:08 2020 +0100
+++ b/ChangeLog	Sat Apr 24 11:30:11 2021 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 1.3.0
+- implemented some code simplifications
+
 Version 1.2.0
 - bug fixes
 - added capability to configure project specific flask settings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PluginFlask.epj	Sat Apr 24 11:30:11 2021 +0200
@@ -0,0 +1,303 @@
+{
+  "header": {
+    "comment": "eric project file for project PluginFlask",
+    "copyright": "Copyright (C) 2021 Detlev Offenbach, detlev@die-offenbachs.de"
+  },
+  "project": {
+    "AUTHOR": "Detlev Offenbach",
+    "CHECKERSPARMS": {
+      "Pep8Checker": {
+        "AnnotationsChecker": {
+          "AllowUntypedDefs": false,
+          "AllowUntypedNested": false,
+          "DispatchDecorators": [
+            "singledispatch",
+            "singledispatchmethod"
+          ],
+          "MaximumComplexity": 3,
+          "MaximumLength": 7,
+          "MinimumCoverage": 75,
+          "MypyInitReturn": false,
+          "OverloadDecorators": [
+            "overload"
+          ],
+          "SuppressDummyArgs": false,
+          "SuppressNoneReturning": false
+        },
+        "BlankLines": [
+          2,
+          1
+        ],
+        "BuiltinsChecker": {
+          "bytes": [
+            "unicode"
+          ],
+          "chr": [
+            "unichr"
+          ],
+          "str": [
+            "unicode"
+          ]
+        },
+        "CommentedCodeChecker": {
+          "Aggressive": false,
+          "WhiteList": [
+            "pylint",
+            "pyright",
+            "noqa",
+            "type:\\s*ignore",
+            "fmt:\\s*(on|off)",
+            "TODO",
+            "FIXME",
+            "WARNING",
+            "NOTE",
+            "TEST",
+            "DOCU",
+            "XXX",
+            "- "
+          ]
+        },
+        "CopyrightAuthor": "",
+        "CopyrightMinFileSize": 0,
+        "DocstringType": "eric",
+        "EnabledCheckerCategories": "C, D, E, M, N, Y, W",
+        "ExcludeFiles": "*/Ui_*.py,",
+        "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W504,Y401,Y402",
+        "FixCodes": "",
+        "FixIssues": false,
+        "FutureChecker": "",
+        "HangClosing": false,
+        "IncludeMessages": "",
+        "LineComplexity": 25,
+        "LineComplexityScore": 10,
+        "MaxCodeComplexity": 10,
+        "MaxDocLineLength": 79,
+        "MaxLineLength": 79,
+        "NoFixCodes": "E501",
+        "RepeatMessages": true,
+        "SecurityChecker": {
+          "CheckTypedException": false,
+          "HardcodedTmpDirectories": [
+            "/tmp",
+            "/var/tmp",
+            "/dev/shm",
+            "~/tmp"
+          ],
+          "InsecureHashes": [
+            "md4",
+            "md5",
+            "sha",
+            "sha1"
+          ],
+          "InsecureSslProtocolVersions": [
+            "PROTOCOL_SSLv2",
+            "SSLv2_METHOD",
+            "SSLv23_METHOD",
+            "PROTOCOL_SSLv3",
+            "PROTOCOL_TLSv1",
+            "SSLv3_METHOD",
+            "TLSv1_METHOD"
+          ],
+          "WeakKeySizeDsaHigh": "1024",
+          "WeakKeySizeDsaMedium": "2048",
+          "WeakKeySizeEcHigh": "160",
+          "WeakKeySizeEcMedium": "224",
+          "WeakKeySizeRsaHigh": "1024",
+          "WeakKeySizeRsaMedium": "2048"
+        },
+        "ShowIgnored": false,
+        "ValidEncodings": "latin-1, utf-8"
+      }
+    },
+    "DESCRIPTION": "Plugin implementing support for Flask projects.",
+    "DOCSTRING": "",
+    "DOCUMENTATIONPARMS": {
+      "ERIC4DOC": {
+        "cssFile": "%PYTHON%/eric6/CSSs/default.css",
+        "ignoreDirectories": [
+          ".eric6project",
+          ".ropeproject",
+          ".hg"
+        ],
+        "ignoreFilePatterns": [
+          "Ui_*"
+        ],
+        "outputDirectory": "ProjectFlask/Documentation/source",
+        "qtHelpEnabled": false,
+        "useRecursion": true
+      }
+    },
+    "EMAIL": "detlev@die-offenbachs.de",
+    "EOL": 1,
+    "FILETYPES": {
+      "*.e4p": "OTHERS",
+      "*.idl": "INTERFACES",
+      "*.md": "OTHERS",
+      "*.proto": "PROTOCOLS",
+      "*.py": "SOURCES",
+      "*.py3": "SOURCES",
+      "*.pyw": "SOURCES",
+      "*.pyw3": "SOURCES",
+      "*.qm": "TRANSLATIONS",
+      "*.qrc": "RESOURCES",
+      "*.rst": "OTHERS",
+      "*.ts": "TRANSLATIONS",
+      "*.txt": "OTHERS",
+      "*.ui": "FORMS",
+      "GNUmakefile": "OTHERS",
+      "Makefile": "OTHERS",
+      "README": "OTHERS",
+      "README.*": "OTHERS",
+      "Ui_*.py": "__IGNORE__",
+      "makefile": "OTHERS"
+    },
+    "FORMS": [
+      "ProjectFlask/ConfigurationPage/FlaskPage.ui",
+      "ProjectFlask/FlaskBabelExtension/PyBabelConfigDialog.ui",
+      "ProjectFlask/FlaskCommandDialog.ui",
+      "ProjectFlask/FlaskConfigDialog.ui",
+      "ProjectFlask/FlaskMigrateExtension/MigrateConfigDialog.ui",
+      "ProjectFlask/FlaskMigrateExtension/MigrateSummaryDialog.ui",
+      "ProjectFlask/FlaskVirtualenvConfigurationDialog.ui",
+      "ProjectFlask/FormSelectionDialog.ui",
+      "ProjectFlask/RoutesDialog.ui",
+      "ProjectFlask/RunServerDialog.ui",
+      "ProjectFlask/ServerStartOptionsDialog.ui"
+    ],
+    "HASH": "b633d75a8cfbd2d511a2bf683c5bc04aa8795bf2",
+    "IDLPARAMS": {
+      "DefinedNames": [],
+      "IncludeDirs": [],
+      "UndefinedNames": []
+    },
+    "INTERFACES": [],
+    "LEXERASSOCS": {},
+    "MAINSCRIPT": "PluginProjectFlask.py",
+    "MAKEPARAMS": {
+      "MakeEnabled": false,
+      "MakeExecutable": "",
+      "MakeFile": "",
+      "MakeParameters": "",
+      "MakeTarget": "",
+      "MakeTestOnly": true
+    },
+    "MIXEDLANGUAGE": false,
+    "OTHERS": [
+      ".hgignore",
+      "ChangeLog",
+      "PKGLIST",
+      "PluginFlask.e4p",
+      "PluginProjectFlask.zip",
+      "ProjectFlask/APIs",
+      "ProjectFlask/Documentation/LICENSE.GPL3",
+      "ProjectFlask/Documentation/source",
+      "ProjectFlask/icons/flask-dark.svg",
+      "ProjectFlask/icons/flask-light.svg",
+      "ProjectFlask/icons/flask64-dark.svg",
+      "ProjectFlask/icons/flask64-light.svg",
+      "PluginFlask.epj"
+    ],
+    "OTHERTOOLSPARMS": {},
+    "PACKAGERSPARMS": {},
+    "PROGLANGUAGE": "Python3",
+    "PROJECTTYPE": "E6Plugin",
+    "PROJECTTYPESPECIFICDATA": {},
+    "PROTOCOLS": [],
+    "RCCPARAMS": {
+      "CompressLevel": 0,
+      "CompressionDisable": false,
+      "CompressionThreshold": 70,
+      "PathPrefix": ""
+    },
+    "RESOURCES": [],
+    "SOURCES": [
+      "PluginProjectFlask.py",
+      "ProjectFlask/AnsiTools.py",
+      "ProjectFlask/ConfigurationPage/FlaskPage.py",
+      "ProjectFlask/ConfigurationPage/__init__.py",
+      "ProjectFlask/FlaskBabelExtension/FlaskBabelDetector.py",
+      "ProjectFlask/FlaskBabelExtension/PyBabelCommandDialog.py",
+      "ProjectFlask/FlaskBabelExtension/PyBabelConfigDialog.py",
+      "ProjectFlask/FlaskBabelExtension/PyBabelProjectExtension.py",
+      "ProjectFlask/FlaskBabelExtension/__init__.py",
+      "ProjectFlask/FlaskCommandDialog.py",
+      "ProjectFlask/FlaskConfigDialog.py",
+      "ProjectFlask/FlaskMigrateExtension/FlaskMigrateDetector.py",
+      "ProjectFlask/FlaskMigrateExtension/MigrateConfigDialog.py",
+      "ProjectFlask/FlaskMigrateExtension/MigrateProjectExtension.py",
+      "ProjectFlask/FlaskMigrateExtension/MigrateSummaryDialog.py",
+      "ProjectFlask/FlaskMigrateExtension/__init__.py",
+      "ProjectFlask/FlaskVirtualenvConfigurationDialog.py",
+      "ProjectFlask/FormSelectionDialog.py",
+      "ProjectFlask/Project.py",
+      "ProjectFlask/RoutesDialog.py",
+      "ProjectFlask/RunServerDialog.py",
+      "ProjectFlask/ServerStartOptionsDialog.py",
+      "ProjectFlask/__init__.py",
+      "__init__.py"
+    ],
+    "SPELLEXCLUDES": "",
+    "SPELLLANGUAGE": "en",
+    "SPELLWORDS": "",
+    "TRANSLATIONEXCEPTIONS": [],
+    "TRANSLATIONPATTERN": "ProjectFlask/i18n/flask_%language%.ts",
+    "TRANSLATIONS": [
+      "ProjectFlask/i18n/flask_de.qm",
+      "ProjectFlask/i18n/flask_de.ts",
+      "ProjectFlask/i18n/flask_empty.ts",
+      "ProjectFlask/i18n/flask_en.qm",
+      "ProjectFlask/i18n/flask_en.ts",
+      "ProjectFlask/i18n/flask_es.qm",
+      "ProjectFlask/i18n/flask_es.ts",
+      "ProjectFlask/i18n/flask_ru.qm",
+      "ProjectFlask/i18n/flask_ru.ts"
+    ],
+    "TRANSLATIONSBINPATH": "",
+    "UICPARAMS": {
+      "Package": "",
+      "PackagesRoot": "",
+      "RcSuffix": ""
+    },
+    "VCS": "Mercurial",
+    "VCSOPTIONS": {
+      "add": [
+        ""
+      ],
+      "checkout": [
+        ""
+      ],
+      "commit": [
+        ""
+      ],
+      "diff": [
+        ""
+      ],
+      "export": [
+        ""
+      ],
+      "global": [
+        ""
+      ],
+      "history": [
+        ""
+      ],
+      "log": [
+        ""
+      ],
+      "remove": [
+        ""
+      ],
+      "status": [
+        ""
+      ],
+      "tag": [
+        ""
+      ],
+      "update": [
+        ""
+      ]
+    },
+    "VCSOTHERDATA": {},
+    "VERSION": "1.x"
+  }
+}
\ No newline at end of file
--- a/PluginProjectFlask.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/PluginProjectFlask.py	Sat Apr 24 11:30:11 2021 +0200
@@ -26,7 +26,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "1.2.0"
+version = "1.3.0"
 className = "ProjectFlaskPlugin"
 packageName = "ProjectFlask"
 shortDescription = "Project support for Flask projects."
@@ -85,10 +85,7 @@
         palette = e5App().palette()
         lightness = palette.color(QPalette.Window).lightness()
         usesDarkPalette = lightness <= 128
-    if usesDarkPalette:
-        iconSuffix = "dark"
-    else:
-        iconSuffix = "light"
+    iconSuffix = "dark" if usesDarkPalette else "light"
     
     return {
         "flaskPage": [
@@ -183,10 +180,7 @@
             palette = e5App().palette()
             lightness = palette.color(QPalette.Window).lightness()
             usesDarkPalette = lightness <= 128
-        if usesDarkPalette:
-            iconSuffix = "dark"
-        else:
-            iconSuffix = "light"
+        iconSuffix = "dark" if usesDarkPalette else "light"
         
         self.__object = Project(self, iconSuffix, self.__ui)
         self.__object.initActions()
@@ -323,18 +317,17 @@
         @return dictionary with file type associations
         @rtype dict
         """
-        if self.__e5project.getProjectType() == "Flask":
-            fileTypes = {
-                "*.py": "SOURCES",
-                "*.js": "SOURCES",
-                "*.html": "FORMS",
-                "*.htm": "FORMS",
-                "*.pot": "TRANSLATIONS",
-                "*.po": "TRANSLATIONS",
-                "*.mo": "TRANSLATIONS",
-            }
-        else:
-            fileTypes = {}
+        fileTypes = (
+            {"*.py": "SOURCES",
+             "*.js": "SOURCES",
+             "*.html": "FORMS",
+             "*.htm": "FORMS",
+             "*.pot": "TRANSLATIONS",
+             "*.po": "TRANSLATIONS",
+             "*.mo": "TRANSLATIONS", }
+            if self.__e5project.getProjectType() == "Flask" else
+            {}
+        )
         return fileTypes
     
     def lexerAssociationCallback(self, filename):
Binary file PluginProjectFlask.zip has changed
--- a/ProjectFlask/ConfigurationPage/FlaskPage.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/ConfigurationPage/FlaskPage.py	Sat Apr 24 11:30:11 2021 +0200
@@ -34,7 +34,7 @@
         
         @param plugin reference to the plugin object
         """
-        super(FlaskPage, self).__init__()
+        super().__init__()
         self.setupUi(self)
         self.setObjectName("FlaskPage")
         
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.PluginProjectFlask.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.PluginProjectFlask.html	Sat Apr 24 11:30:11 2021 +0200
@@ -212,7 +212,7 @@
         Public method to activate this plugin.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 tuple of None and activation status
 </dd>
@@ -239,7 +239,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 name of the binary translation file
 </dd>
@@ -265,7 +265,7 @@
         Public method get the filetype associations of the Django project type.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 dictionary with file type associations
 </dd>
@@ -291,7 +291,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 the requested setting
 </dd>
@@ -317,7 +317,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 reference to the menu or None, if no
             menu with the given name exists
@@ -337,7 +337,7 @@
         Public method to get the names of all menus.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 menu names
 </dd>
@@ -363,7 +363,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 the requested setting
 </dd>
@@ -390,7 +390,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 name of the lexer (Pygments lexers are prefixed with
             'Pygments|')
@@ -438,7 +438,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 list of API filenames (list of string)
 </dd>
@@ -461,7 +461,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 reference to the configuration page
 </dd>
@@ -477,7 +477,7 @@
     Module function returning data as required by the configuration dialog.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 dictionary containing the relevant data
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.AnsiTools.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.AnsiTools.html	Sat Apr 24 11:30:11 2021 +0200
@@ -58,7 +58,7 @@
     Function to get a list of available color schemes.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 list containing the names of the supported color schemes
 </dd>
@@ -91,7 +91,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 brush for the given parameters or None in case of error
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelCommandDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelCommandDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -217,7 +217,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating a successful start of the first process
 </dd>
@@ -255,7 +255,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating a successful start
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelConfigDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelConfigDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -143,7 +143,7 @@
         Public method to get the entered configuration data.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 pybabel configuration
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelProjectExtension.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskBabelExtension.PyBabelProjectExtension.html	Sat Apr 24 11:30:11 2021 +0200
@@ -222,7 +222,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating successful configuration file creation
 </dd>
@@ -241,7 +241,7 @@
         Private method to ensure, that PyBabel has been configured.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating successful configuration
 </dd>
@@ -260,7 +260,7 @@
         Private method to check, if the 'flask-babel' package is available.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating the availability of 'flask-babel'
 </dd>
@@ -286,7 +286,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 extracted locale
 </dd>
@@ -369,7 +369,7 @@
         Public method to build the Babel command.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 full pybabel command
 </dd>
@@ -395,7 +395,7 @@
         Public method to initialize the flask-babel menu.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 the menu generated
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskCommandDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskCommandDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -191,7 +191,7 @@
         Public method to test, if the process ended without errors.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating a normal process exit
 </dd>
@@ -235,7 +235,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating a successful start
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskConfigDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskConfigDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -122,7 +122,7 @@
 </p>
 <dl>
 
-<dt><i>venvtDir</i> (str)</dt>
+<dt><i>venvDir</i> (str)</dt>
 <dd>
 directory containing the virtual environment
 </dd>
@@ -135,7 +135,7 @@
         Public method to get the entered configuration data.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 project specific configuration
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskMigrateExtension.MigrateConfigDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskMigrateExtension.MigrateConfigDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -109,7 +109,7 @@
         Public method to get the entered configuration data.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 pybabel configuration
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskMigrateExtension.MigrateProjectExtension.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskMigrateExtension.MigrateProjectExtension.html	Sat Apr 24 11:30:11 2021 +0200
@@ -201,7 +201,7 @@
         Private method to check, if the 'flask-babel' package is available.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating the availability of 'flask-babel'
 </dd>
@@ -243,7 +243,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 path of the migrations directory
 </dd>
@@ -304,7 +304,7 @@
         Public method to initialize the flask-migrate menu.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 the menu generated
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskVirtualenvConfigurationDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FlaskVirtualenvConfigurationDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -135,7 +135,7 @@
         Private method to generate a valid target directory path.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 target directory path
 </dd>
@@ -165,7 +165,7 @@
         returned by the eric virtual environment configuration dialog.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 dictionary containing the data for the environment to be
             created. The keys for both variants are 'arguments' containing the
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FormSelectionDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.FormSelectionDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -109,7 +109,7 @@
         Public method to get the template text.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 text of the template
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.Project.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.Project.html	Sat Apr 24 11:30:11 2021 +0200
@@ -275,7 +275,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating a suitable file was found
 </dd>
@@ -367,7 +367,7 @@
         working directory.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 tuple containing the working directory and the application name
 </dd>
@@ -397,7 +397,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 referenced data
 </dd>
@@ -416,7 +416,7 @@
         Public method to build the Flask command.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 full flask command
 </dd>
@@ -436,7 +436,7 @@
         string.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 dictionary containing the Flask, Werkzeug and Python versions
 </dd>
@@ -466,7 +466,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 full command
 </dd>
@@ -492,7 +492,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 reference to the menu or None, if no menu with the given
             name exists
@@ -512,7 +512,7 @@
         Public method to get the names of all menus.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 menu names
 </dd>
@@ -531,7 +531,7 @@
         Public method to get the path of the virtual environment.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 path of the virtual environment
 </dd>
@@ -551,7 +551,7 @@
         with the current project.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 path of the Python interpreter
 </dd>
@@ -577,7 +577,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating the availability of the capability
 </dd>
@@ -603,7 +603,7 @@
         Public method to initialize the Flask menu.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 the menu generated
 </dd>
@@ -644,7 +644,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 tuple containing the working directory and a prepared
             environment object to be used with QProcess
@@ -725,7 +725,7 @@
         Public method to get the supported Python variants.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 list of supported Python variants
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.RoutesDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.RoutesDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -218,7 +218,7 @@
         Public method to show the list of routes.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating success
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.RunServerDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.RunServerDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -242,7 +242,7 @@
 </dd>
 </dl>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 flag indicating success
 </dd>
--- a/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.ServerStartOptionsDialog.html	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Documentation/source/Plugin_Project_Flask.ProjectFlask.ServerStartOptionsDialog.html	Sat Apr 24 11:30:11 2021 +0200
@@ -109,7 +109,7 @@
         Public method to get a dictionary containing the entered data.
 </p>
 <dl>
-<dt>Returns:</dt>
+<dt>Return:</dt>
 <dd>
 dictionary containing the entered data
 </dd>
--- a/ProjectFlask/FlaskBabelExtension/PyBabelCommandDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskBabelExtension/PyBabelCommandDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -35,7 +35,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(PyBabelCommandDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         if title:
--- a/ProjectFlask/FlaskBabelExtension/PyBabelConfigDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskBabelExtension/PyBabelConfigDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -31,7 +31,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(PyBabelConfigDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.__e5project = e5App().getObject("Project")
--- a/ProjectFlask/FlaskBabelExtension/PyBabelProjectExtension.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskBabelExtension/PyBabelProjectExtension.py	Sat Apr 24 11:30:11 2021 +0200
@@ -9,6 +9,7 @@
 
 import os
 import re
+import contextlib
 
 from PyQt5.QtCore import pyqtSlot, QObject, QProcess
 from PyQt5.QtWidgets import QDialog, QMenu
@@ -37,7 +38,7 @@
         @param parent parent
         @type QObject
         """
-        super(PyBabelProject, self).__init__(parent)
+        super().__init__(parent)
         
         self.__plugin = plugin
         self.__project = project
@@ -200,11 +201,11 @@
         """
         Public method to determine the availability of flask-babel.
         """
-        if self.__project.getData("flask", "flask_babel_override"):
-            available = self.__project.getData("flask",
-                                               "flask_babel_available")
-        else:
-            available = self.__flaskBabelAvailable()
+        available = (
+            self.__project.getData("flask", "flask_babel_available")
+            if self.__project.getData("flask", "flask_babel_override") else
+            self.__flaskBabelAvailable()
+        )
         self.__project.setCapability("flask-babel", available)
         
         self.pybabelConfigAct.setEnabled(available)
@@ -304,18 +305,15 @@
         @rtype bool
         """
         _, app = self.__project.getApplication()
-        if app.endswith(".py"):
-            template = (
-                "[python: {0}]\n"
-                "[jinja2: templates/**.html]\n"
-                "extensions=jinja2.ext.autoescape,jinja2.ext.with_\n"
-            )
-        else:
-            template = (
-                "[python: {0}/**.py]\n"
-                "[jinja2: {0}/templates/**.html]\n"
-                "extensions=jinja2.ext.autoescape,jinja2.ext.with_\n"
-            )
+        template = (
+            ("[python: {0}]\n"
+             "[jinja2: templates/**.html]\n"
+             "extensions=jinja2.ext.autoescape,jinja2.ext.with_\n")
+            if app.endswith(".py") else
+            ("[python: {0}/**.py]\n"
+             "[jinja2: {0}/templates/**.html]\n"
+             "extensions=jinja2.ext.autoescape,jinja2.ext.with_\n")
+        )
         try:
             with open(configFile, "w") as f:
                 f.write(template.format(app))
@@ -364,10 +362,11 @@
         Private slot to check the availability of the 'flask-babel' extension.
         """
         self.determineCapability()
-        if self.__project.hasCapability("flask-babel"):
-            msg = self.tr("The 'flask-babel' extension is installed.")
-        else:
-            msg = self.tr("The 'flask-babel' extension is not installed.")
+        msg = (
+            self.tr("The 'flask-babel' extension is installed.")
+            if self.__project.hasCapability("flask-babel") else
+            self.tr("The 'flask-babel' extension is not installed.")
+        )
         E5MessageBox.information(
             None,
             self.tr("flask-babel Availability"),
@@ -427,11 +426,9 @@
             potFile = self.__e5project.getAbsoluteUniversalPath(
                 self.__project.getData("flask-babel", "catalogFile"))
             
-            try:
+            with contextlib.suppress(OSError):
                 potFilePath = os.path.dirname(potFile)
                 os.makedirs(potFilePath)
-            except OSError:
-                pass
             
             args = [
                 "-F",
@@ -442,7 +439,8 @@
                 )
             ]
             if self.__project.getData("flask-babel", "markersList"):
-                for marker in self.__project.getData("flask-babel", "markersList"):
+                for marker in self.__project.getData("flask-babel",
+                                                     "markersList"):
                     args += ["-k", marker]
             args += [
                 "-o",
--- a/ProjectFlask/FlaskCommandDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskCommandDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -35,7 +35,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(FlaskCommandDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         if title:
--- a/ProjectFlask/FlaskConfigDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskConfigDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -33,7 +33,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(FlaskConfigDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.newEnvironmentButton.setIcon(
@@ -129,7 +129,7 @@
         """
         Private method to install flask into the newly created environment.
         
-        @param venvtDir  directory containing the virtual environment
+        @param venvDir  directory containing the virtual environment
         @type str
         """
         from PipInterface.PipDialog import PipDialog
--- a/ProjectFlask/FlaskMigrateExtension/MigrateConfigDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskMigrateExtension/MigrateConfigDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -29,7 +29,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(MigrateConfigDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.__e5project = e5App().getObject("Project")
--- a/ProjectFlask/FlaskMigrateExtension/MigrateProjectExtension.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskMigrateExtension/MigrateProjectExtension.py	Sat Apr 24 11:30:11 2021 +0200
@@ -38,7 +38,7 @@
         @param parent parent
         @type QObject
         """
-        super(MigrateProject, self).__init__(parent)
+        super().__init__(parent)
         
         self.__plugin = plugin
         self.__project = project
@@ -242,19 +242,20 @@
         """
         Public method to determine the availability of flask-migrate.
         """
-        if self.__project.getData("flask", "flask_migrate_override"):
-            available = self.__project.getData("flask",
-                                               "flask_migrate_available")
-        else:
-            available = self.__flaskMigrateAvailable()
+        available = (
+            self.__project.getData("flask", "flask_migrate_available")
+            if self.__project.getData("flask", "flask_migrate_override") else
+            self.__flaskMigrateAvailable()
+        )
         self.__project.setCapability("flask-migrate", available)
         
         self.migrateInstallAct.setEnabled(not available)
         
-        for act in (self.migrateConfigAct, self.migrateInitAct,
-                    self.migrateCreateAct,
-                    self.upgradeDatabaseAct, self.downgradeDatabaseAct,
-                    self.migrationSummaryAct, self.migrationHistoryAct,
+        for act in (
+            self.migrateConfigAct, self.migrateInitAct,
+            self.migrateCreateAct,
+            self.upgradeDatabaseAct, self.downgradeDatabaseAct,
+            self.migrationSummaryAct, self.migrationHistoryAct,
         ):
             act.setEnabled(available)
     
@@ -370,10 +371,11 @@
         Private slot to check the availability of the 'flask-babel' extension.
         """
         self.determineCapability()
-        if self.__project.hasCapability("flask-migrate"):
-            msg = self.tr("The 'flask-migrate' extension is installed.")
-        else:
-            msg = self.tr("The 'flask-migrate' extension is not installed.")
+        msg = (
+            self.tr("The 'flask-migrate' extension is installed.")
+            if self.__project.hasCapability("flask-migrate") else
+            self.tr("The 'flask-migrate' extension is not installed.")
+        )
         E5MessageBox.information(
             None,
             self.tr("flask-migrate Availability"),
--- a/ProjectFlask/FlaskMigrateExtension/MigrateSummaryDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskMigrateExtension/MigrateSummaryDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -36,7 +36,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(MigrateSummaryDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.__refreshButton = self.buttonBox.addButton(
--- a/ProjectFlask/FlaskVirtualenvConfigurationDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FlaskVirtualenvConfigurationDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -44,7 +44,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(FlaskVirtualenvConfigurationDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.targetDirectoryPicker.setMode(E5PathPickerModes.DirectoryMode)
--- a/ProjectFlask/FormSelectionDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/FormSelectionDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -88,7 +88,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(FormSelectionDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
--- a/ProjectFlask/Project.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/Project.py	Sat Apr 24 11:30:11 2021 +0200
@@ -42,7 +42,7 @@
         @param parent parent
         @type QObject
         """
-        super(Project, self).__init__(parent)
+        super().__init__(parent)
         
         self.__plugin = plugin
         self.__iconSuffix = iconSuffix
@@ -393,11 +393,11 @@
                     "VirtualEnvironmentNamePy3")
         else:
             venvName = ""
-        if venvName:
-            virtEnv = self.__virtualEnvManager.getVirtualenvDirectory(
-                venvName)
-        else:
-            virtEnv = ""
+        virtEnv = (
+            self.__virtualEnvManager.getVirtualenvDirectory(venvName)
+            if venvName else
+            ""
+        )
         
         if virtEnv and not os.path.exists(virtEnv):
             virtEnv = ""
@@ -426,19 +426,16 @@
         @rtype str
         """
         virtualEnv = virtualEnvPath or self.getVirtualEnvironment()
-        if isWindowsPlatform():
-            fullCmds = [
-                os.path.join(virtualEnv, "Scripts", command + '.exe'),
-                os.path.join(virtualEnv, "bin", command + '.exe'),
-                command     # fall back to just cmd
-            ]
-        else:
-            fullCmds = [
-                os.path.join(virtualEnv, "bin", command),
-                os.path.join(virtualEnv, "local", "bin", command),
-                Utilities.getExecutablePath(command),
-                command     # fall back to just cmd
-            ]
+        fullCmds = (
+            [os.path.join(virtualEnv, "Scripts", command + '.exe'),
+             os.path.join(virtualEnv, "bin", command + '.exe'),
+             command]     # fall back to just cmd
+            if isWindowsPlatform() else
+            [os.path.join(virtualEnv, "bin", command),
+             os.path.join(virtualEnv, "local", "bin", command),
+             Utilities.getExecutablePath(command),
+             command]     # fall back to just cmd
+        )
         for command in fullCmds:
             if os.path.exists(command):
                 break
--- a/ProjectFlask/RoutesDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/RoutesDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -29,7 +29,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(RoutesDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.__refreshButton = self.buttonBox.addButton(
--- a/ProjectFlask/RunServerDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/RunServerDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -40,7 +40,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(RunServerDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.__plugin = plugin
--- a/ProjectFlask/ServerStartOptionsDialog.py	Wed Dec 30 11:02:08 2020 +0100
+++ b/ProjectFlask/ServerStartOptionsDialog.py	Sat Apr 24 11:30:11 2021 +0200
@@ -28,7 +28,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(ServerStartOptionsDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         e5project = e5App().getObject("Project")

eric ide

mercurial