Sat, 23 Dec 2023 16:46:05 +0100
Corrected some code style issues and converted some source code documentation to the new style.
diff -r 7b03dfe583e3 -r a4b66a1acea6 PluginDjango.epj --- a/PluginDjango.epj Sat Dec 23 15:48:51 2023 +0100 +++ b/PluginDjango.epj Sat Dec 23 16:46:05 2023 +0100 @@ -1,7 +1,7 @@ { "header": { "comment": "eric project file for project PluginDjango", - "copyright": "Copyright (C) 2022 Detlev Offenbach, detlev@die-offenbachs.de" + "copyright": "Copyright (C) 2023 Detlev Offenbach, detlev@die-offenbachs.de" }, "project": { "AUTHOR": "Detlev Offenbach", @@ -11,10 +11,14 @@ "AllowStarArgAny": false, "AllowUntypedDefs": false, "AllowUntypedNested": false, + "CheckFutureAnnotations": false, "DispatchDecorators": [ "singledispatch", "singledispatchmethod" ], + "ExemptedTypingSymbols": [ + "" + ], "ForceFutureAnnotations": false, "MaximumComplexity": 3, "MaximumLength": 7, @@ -62,15 +66,18 @@ "CopyrightAuthor": "", "CopyrightMinFileSize": 0, "DocstringType": "eric_black", - "EnabledCheckerCategories": "C, D, E, M, N, Y, W", + "EnabledCheckerCategories": "C, D, E, I, L, M, NO, N, Y, U, W", "ExcludeFiles": "*/Ui_*.py, */*_rc.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,W503,Y401,Y402", + "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,M852,N802,N803,N807,N808,N821,W293,W503,Y401,Y402", "FixCodes": "", "FixIssues": false, "FutureChecker": "", "HangClosing": false, "ImportsChecker": { - "ApplicationPackageNames": [], + "ApplicationPackageNames": [ + "ProjectDjango", + "eric7" + ], "BanRelativeImports": "", "BannedModules": [] }, @@ -80,6 +87,17 @@ "MaxCodeComplexity": 10, "MaxDocLineLength": 88, "MaxLineLength": 88, + "NameOrderChecker": { + "ApplicationPackageNames": [ + "ProjectDjango", + "eric7" + ], + "CombinedAsImports": false, + "SortCaseSensitive": false, + "SortFromFirst": false, + "SortIgnoringStyle": false, + "SortOrder": "natural" + }, "NoFixCodes": "E501", "RepeatMessages": true, "SecurityChecker": { @@ -113,6 +131,19 @@ "WeakKeySizeRsaMedium": "2048" }, "ShowIgnored": false, + "UnusedChecker": { + "IgnoreAbstract": true, + "IgnoreDunderGlobals": true, + "IgnoreDunderMethods": true, + "IgnoreEventHandlerMethods": false, + "IgnoreLambdas": false, + "IgnoreNestedFunctions": false, + "IgnoreOverload": true, + "IgnoreOverride": true, + "IgnoreSlotMethods": false, + "IgnoreStubs": true, + "IgnoreVariadicNames": false + }, "ValidEncodings": "latin-1, utf-8" } }, @@ -131,6 +162,7 @@ ], "outputDirectory": "ProjectDjango/Documentation/source", "qtHelpEnabled": false, + "startDirectory": "", "useRecursion": true } }, @@ -212,7 +244,7 @@ ], "OTHERTOOLSPARMS": { "Black": { - "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|\\.ipynb_checkpoints|_build|buck-out|build|dist|__pypackages__)/", + "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.ipynb_checkpoints|\\.mypy_cache|\\.nox|\\.pytest_cache|\\.ruff_cache|\\.tox|\\.svn|\\.venv|\\.vscode|__pypackages__|_build|buck-out|build|dist|venv)/", "extend-exclude": "", "force-exclude": "", "line-length": 88, @@ -220,6 +252,7 @@ "skip-string-normalization": false, "source": "project", "target-version": [ + "py312", "py311", "py310", "py39", @@ -277,6 +310,7 @@ "ProjectDjango/__init__.py", "__init__.py" ], + "SOURCESDIR": "", "SPELLEXCLUDES": "", "SPELLLANGUAGE": "en", "SPELLWORDS": "",
diff -r 7b03dfe583e3 -r a4b66a1acea6 PluginProjectDjango.py --- a/PluginProjectDjango.py Sat Dec 23 15:48:51 2023 +0100 +++ b/PluginProjectDjango.py Sat Dec 23 16:46:05 2023 +0100 @@ -60,7 +60,7 @@ return apis -def createDjangoPage(configDlg): +def createDjangoPage(configDlg): # noqa: U100 """ Module function to create the Django configuration page. @@ -69,8 +69,9 @@ @return reference to the configuration page @rtype DjangoPage """ + from ProjectDjango.ConfigurationPage.DjangoPage import DjangoPage + global djangoPluginObject - from ProjectDjango.ConfigurationPage.DjangoPage import DjangoPage page = DjangoPage(djangoPluginObject) return page @@ -206,27 +207,10 @@ progLanguages=self.__supportedVariants[:], ) - try: - # backward compatibility for eric7 < 22.12 - from eric7.Project.ProjectBrowser import ( - FormsBrowserFlag, - OthersBrowserFlag, - SourcesBrowserFlag, - TranslationsBrowserFlag, - ) - - Preferences.setProjectBrowserFlagsDefault( - "Django", - SourcesBrowserFlag - | FormsBrowserFlag - | TranslationsBrowserFlag - | OthersBrowserFlag, - ) - except ImportError: - Preferences.setProjectBrowsersDefault( - "Django", - ("sources", "forms", "translations", "others"), - ) + Preferences.setProjectBrowsersDefault( + "Django", + ("sources", "forms", "translations", "others"), + ) if self.__ericProject.isOpen(): self.__projectOpened() @@ -463,9 +447,10 @@ """ Public method to get a reference to the requested menu. - @param name name of the menu (string) - @return reference to the menu (QMenu) or None, if no - menu with the given name exists + @param name name of the menu + @type str + @return reference to the menu or None, if no menu with the given name exists + @rtype QMenu """ if self.__object is not None: return self.__object.getMenu(name) @@ -476,7 +461,8 @@ """ Public method to get the names of all menus. - @return menu names (list of string) + @return menu names + @rtype list of str """ if self.__object is not None: return list(self.__menus.keys()) @@ -485,4 +471,4 @@ # -# eflag: noqa = M801 +# eflag: noqa = M801, U200
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/ConfigurationPage/DjangoPage.py --- a/ProjectDjango/ConfigurationPage/DjangoPage.py Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/ConfigurationPage/DjangoPage.py Sat Dec 23 16:46:05 2023 +0100 @@ -32,6 +32,7 @@ Constructor @param plugin reference to the plugin object + @type ProjectDjangoPlugin """ super().__init__() self.setupUi(self)
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/DjangoLoaddataDataDialog.py --- a/ProjectDjango/DjangoLoaddataDataDialog.py Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/DjangoLoaddataDataDialog.py Sat Dec 23 16:46:05 2023 +0100 @@ -58,7 +58,8 @@ """ Private slot to handle a change of the fixtures text. - @param txt text of the line edit (string) + @param txt text of the line edit + @type str """ self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(bool(txt))
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/DjangoMigrationsListDialog.py --- a/ProjectDjango/DjangoMigrationsListDialog.py Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/DjangoMigrationsListDialog.py Sat Dec 23 16:46:05 2023 +0100 @@ -128,7 +128,7 @@ self.__resizeColumns() - def __procFinished(self, exitCode, exitStatus): + def __procFinished(self, exitCode, exitStatus): # noqa: U100 """ Private slot connected to the finished signal.
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/DjangoSquashMigrationSelectionDialog.py --- a/ProjectDjango/DjangoSquashMigrationSelectionDialog.py Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/DjangoSquashMigrationSelectionDialog.py Sat Dec 23 16:46:05 2023 +0100 @@ -84,7 +84,7 @@ self.__updateOkButton() @pyqtSlot(str) - def on_endMigrationComboBox_activated(self, migration): + def on_endMigrationComboBox_activated(self, migration): # noqa: U100 """ Private slot handling the selection of a migration.
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/Documentation/source/Plugin_Project_Django.PluginProjectDjango.html --- a/ProjectDjango/Documentation/source/Plugin_Project_Django.PluginProjectDjango.html Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/Documentation/source/Plugin_Project_Django.PluginProjectDjango.html Sat Dec 23 16:46:05 2023 +0100 @@ -267,16 +267,21 @@ </p> <dl> -<dt><i>name</i></dt> +<dt><i>name</i> (str)</dt> <dd> -name of the menu (string) +name of the menu </dd> </dl> <dl> <dt>Return:</dt> <dd> -reference to the menu (QMenu) or None, if no - menu with the given name exists +reference to the menu or None, if no menu with the given name exists +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +QMenu </dd> </dl> <a NAME="ProjectDjangoPlugin.getMenuNames" ID="ProjectDjangoPlugin.getMenuNames"></a> @@ -289,7 +294,13 @@ <dl> <dt>Return:</dt> <dd> -menu names (list of string) +menu names +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of str </dd> </dl> <a NAME="ProjectDjangoPlugin.getPreferences" ID="ProjectDjangoPlugin.getPreferences"></a>
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.ConfigurationPage.DjangoPage.html --- a/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.ConfigurationPage.DjangoPage.html Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.ConfigurationPage.DjangoPage.html Sat Dec 23 16:46:05 2023 +0100 @@ -78,7 +78,7 @@ </p> <dl> -<dt><i>plugin</i></dt> +<dt><i>plugin</i> (ProjectDjangoPlugin)</dt> <dd> reference to the plugin object </dd>
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.DjangoDialog.html --- a/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.DjangoDialog.html Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.DjangoDialog.html Sat Dec 23 16:46:05 2023 +0100 @@ -128,7 +128,7 @@ <a NAME="DjangoDialog.__init__" ID="DjangoDialog.__init__"></a> <h4>DjangoDialog (Constructor)</h4> -<b>DjangoDialog</b>(<i>text, fixed=False, linewrap=True, msgSuccess=None, msgError=None, saveFilters=None, showInput=False, parent=None</i>) +<b>DjangoDialog</b>(<i>text, fixed=False, linewrap=True, msgSuccess=None, msgError=None, saveFilters=None, showInput=False, parent=None, </i>) <p> Constructor
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.DjangoLoaddataDataDialog.html --- a/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.DjangoLoaddataDataDialog.html Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.DjangoLoaddataDataDialog.html Sat Dec 23 16:46:05 2023 +0100 @@ -132,9 +132,9 @@ </p> <dl> -<dt><i>txt</i></dt> +<dt><i>txt</i> (str)</dt> <dd> -text of the line edit (string) +text of the line edit </dd> </dl> <div align="right"><a href="#top">Up</a></div>
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.Project.html --- a/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.Project.html Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/Documentation/source/Plugin_Project_Django.ProjectDjango.Project.html Sat Dec 23 16:46:05 2023 +0100 @@ -21,7 +21,7 @@ <table> <tr> -<td><a href="#DjangoNoSiteSelectedException">DjangoNoSiteSelectedException</a></td> +<td><a href="#DjangoNoSiteSelectedError">DjangoNoSiteSelectedError</a></td> <td>Exception thrown to signal, that there is no current site.</td> </tr> <tr> @@ -40,8 +40,8 @@ </table> <hr /> <hr /> -<a NAME="DjangoNoSiteSelectedException" ID="DjangoNoSiteSelectedException"></a> -<h2>DjangoNoSiteSelectedException</h2> +<a NAME="DjangoNoSiteSelectedError" ID="DjangoNoSiteSelectedError"></a> +<h2>DjangoNoSiteSelectedError</h2> <p> Exception thrown to signal, that there is no current site. @@ -1460,7 +1460,7 @@ </dl> <dl> -<dt>Raises <b>DjangoNoSiteSelectedException</b>:</dt> +<dt>Raises <b>DjangoNoSiteSelectedError</b>:</dt> <dd> raised, if no site is selected </dd> @@ -1512,7 +1512,7 @@ </dl> <dl> -<dt>Raises <b>DjangoNoSiteSelectedException</b>:</dt> +<dt>Raises <b>DjangoNoSiteSelectedError</b>:</dt> <dd> raised, if no site is selected </dd> @@ -1760,7 +1760,13 @@ <dl> <dt>Return:</dt> <dd> -list of recent applications entries (list of strings) +list of recent applications entries +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of str </dd> </dl> <a NAME="Project.getRecentDatabaseNames" ID="Project.getRecentDatabaseNames"></a> @@ -2121,7 +2127,7 @@ </dl> <a NAME="QProcess.startDetached" ID="QProcess.startDetached"></a> <h4>QProcess.startDetached (static)</h4> -<b>startDetached</b>(<i>args=None, path=''</i>) +<b>startDetached</b>(<i>args=None, path=""</i>) <p> Public static method to start the given program (cmd) in a new process,
diff -r 7b03dfe583e3 -r a4b66a1acea6 ProjectDjango/Project.py --- a/ProjectDjango/Project.py Sat Dec 23 15:48:51 2023 +0100 +++ b/ProjectDjango/Project.py Sat Dec 23 16:46:05 2023 +0100 @@ -337,7 +337,7 @@ ) self.helpAct.setStatusTip(self.tr("Shows the Django help index")) self.helpAct.setWhatsThis( - self.tr("""<b>Help</b>""" """<p>Shows the Django help index page.</p>""") + self.tr("""<b>Help</b><p>Shows the Django help index page.</p>""") ) self.helpAct.triggered.connect(self.__showHelpIndex) self.actions.append(self.helpAct) @@ -425,9 +425,7 @@ "django_database_inspect", ) self.inspectDatabaseAct.setStatusTip( - self.tr( - "Introspects the database tables and outputs a Django model" " module" - ) + self.tr("Introspects the database tables and outputs a Django model module") ) self.inspectDatabaseAct.setWhatsThis( self.tr( @@ -539,9 +537,7 @@ "django_database_sql_apply_migration", ) self.databaseSqlMigrateAct.setStatusTip( - self.tr( - "Prints the SQL statements to apply a migration of an" " application" - ) + self.tr("Prints the SQL statements to apply a migration of an application") ) self.databaseSqlMigrateAct.setWhatsThis( self.tr( @@ -563,7 +559,7 @@ ) self.databaseSqlMigrateBackwardsAct.setStatusTip( self.tr( - "Prints the SQL statements to unapply a migration of an" " application" + "Prints the SQL statements to unapply a migration of an application" ) ) self.databaseSqlMigrateBackwardsAct.setWhatsThis( @@ -655,9 +651,7 @@ ) self.dumpDataAct.setStatusTip(self.tr("Dump the database data to a fixture")) self.dumpDataAct.setWhatsThis( - self.tr( - """<b>Dump Data</b>""" """<p>Dump the database data to a fixture.</p>""" - ) + self.tr("""<b>Dump Data</b><p>Dump the database data to a fixture.</p>""") ) self.dumpDataAct.triggered.connect(self.__dumpData) self.actions.append(self.dumpDataAct) @@ -672,7 +666,7 @@ ) self.loadDataAct.setStatusTip(self.tr("Load data from fixture files")) self.loadDataAct.setWhatsThis( - self.tr("""<b>Load Data</b>""" """<p>Load data from fixture files.</p>""") + self.tr("""<b>Load Data</b><p>Load data from fixture files.</p>""") ) self.loadDataAct.triggered.connect(self.__loadData) self.actions.append(self.loadDataAct) @@ -1296,13 +1290,9 @@ f.write(" <head>\n") f.write(' <meta content="" />\n') f.write(" <title></title>\n") - f.write( - ' <link rel="stylesheet" type="text/css"' ' href="style.css"/>' - ) + f.write(' <link rel="stylesheet" type="text/css" href="style.css"/>') f.write(" <!--[if lte IE 7]>") - f.write( - ' <link rel="stylesheet" type="text/css"' ' href="ie.css"/>' - ) + f.write(' <link rel="stylesheet" type="text/css" href="ie.css"/>') f.write(" <![endif]-->") f.write(" </head>\n") f.write("\n") @@ -1703,7 +1693,8 @@ """ Public method to get the list of recent applications. - @return list of recent applications entries (list of strings) + @return list of recent applications entries + @rtype list of str """ self.__loadRecentApplications() return self.__recentApplications @@ -2040,7 +2031,7 @@ applName, ok = QInputDialog.getText( self.__ui, self.tr("Start Global Django Application"), - self.tr("Enter the name of the new global Django" " application."), + self.tr("Enter the name of the new global Django application."), QLineEdit.EchoMode.Normal, ) if ok and applName != "": @@ -2271,7 +2262,7 @@ None, self.tr("Run Web-Browser"), self.tr( - "Could not start the web-browser for the" ' url "{0}".' + 'Could not start the web-browser for the url "{0}".' ).format(url.toString()), ) else: @@ -2423,9 +2414,7 @@ res = EricMessageBox.yesNo( self.__ui, title, - self.tr( - """Flushing the database will destroy all data.""" """ Are you sure?""" - ), + self.tr("""Flushing the database will destroy all data. Are you sure?"""), ) if res: args = [] @@ -2437,7 +2426,7 @@ args.append("--database={0}".format(self.__currentDatabase)) dia = DjangoDialog( - title, msgSuccess=self.tr("Database tables flushed" " successfully.") + title, msgSuccess=self.tr("Database tables flushed successfully.") ) res = dia.startProcess(args, path) if res: @@ -2535,6 +2524,8 @@ a migration @type bool """ + from .DjangoMigrationSelectionDialog import DjangoMigrationSelectionDialog + try: path = self.__sitePath() except DjangoNoSiteSelectedError: @@ -2549,8 +2540,6 @@ title = self.tr("SQL Migrate") - from .DjangoMigrationSelectionDialog import DjangoMigrationSelectionDialog - dlg = DjangoMigrationSelectionDialog( migrations, migrationRequired=True, suffix=self.__iconSuffix ) @@ -2585,13 +2574,13 @@ """ Private slot to show the available migrations and their status. """ + from .DjangoMigrationsListDialog import DjangoMigrationsListDialog + try: path = self.__sitePath() except DjangoNoSiteSelectedError: return - from .DjangoMigrationsListDialog import DjangoMigrationsListDialog - self.__migrationsListDialog = DjangoMigrationsListDialog( DjangoMigrationsListDialog.MigrationsListMode, self, self.__ui ) @@ -2604,13 +2593,13 @@ """ Private slot to show the migrations plan. """ + from .DjangoMigrationsListDialog import DjangoMigrationsListDialog + try: path = self.__sitePath() except DjangoNoSiteSelectedError: return - from .DjangoMigrationsListDialog import DjangoMigrationsListDialog - self.__migrationsPlanDialog = DjangoMigrationsListDialog( DjangoMigrationsListDialog.MigrationsPlanMode, self, self.__ui ) @@ -2629,6 +2618,8 @@ """ Private slot to apply selected migrations of a selected app. """ + from .DjangoMigrationSelectionDialog import DjangoMigrationSelectionDialog + migrations = self.__getMigrations() if not migrations: EricMessageBox.information( @@ -2638,8 +2629,6 @@ ) return - from .DjangoMigrationSelectionDialog import DjangoMigrationSelectionDialog - dlg = DjangoMigrationSelectionDialog(migrations, suffix=self.__iconSuffix) if dlg.exec() == QDialog.DialogCode.Accepted: app, migration = dlg.getData() @@ -2814,6 +2803,10 @@ """ Private slot to squash migrations. """ + from .DjangoSquashMigrationSelectionDialog import ( + DjangoSquashMigrationSelectionDialog, + ) + migrations = self.__getMigrations() if not migrations: EricMessageBox.information( @@ -2823,10 +2816,6 @@ ) return - from .DjangoSquashMigrationSelectionDialog import ( - DjangoSquashMigrationSelectionDialog, - ) - dlg = DjangoSquashMigrationSelectionDialog(migrations, self, self.__iconSuffix) if dlg.exec() == QDialog.DialogCode.Accepted: app, start, end, noOptimize, name = dlg.getData() @@ -2865,10 +2854,10 @@ """ Private slot to show the changes made to the settings.py file. """ + from .DjangoDiffsettingsDataDialog import DjangoDiffsettingsDataDialog + title = self.tr("Diff Settings") - from .DjangoDiffsettingsDataDialog import DjangoDiffsettingsDataDialog - dlg = DjangoDiffsettingsDataDialog(self, self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: showAll, defaultModule, outputFormat = dlg.getData() @@ -2927,10 +2916,10 @@ """ Private slot to send a test email through Django. """ + from .DjangoSendTestEmailDataDialog import DjangoSendTestEmailDataDialog + title = self.tr("Send Test Email") - from .DjangoSendTestEmailDataDialog import DjangoSendTestEmailDataDialog - dlg = DjangoSendTestEmailDataDialog(self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: managers, admins, recipients = dlg.getData() @@ -2997,6 +2986,8 @@ """ Private slot to dump the database data to a fixture. """ + from .DjangoDumpdataDataDialog import DjangoDumpdataDataDialog + title = self.tr("Dump Data") try: @@ -3004,8 +2995,6 @@ except DjangoNoSiteSelectedError: return - from .DjangoDumpdataDataDialog import DjangoDumpdataDataDialog - dlg = DjangoDumpdataDataDialog(self, self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: appls, excls, dumpFormat, indent = dlg.getData() @@ -3040,6 +3029,8 @@ """ Private slot to load data from fixture files. """ + from .DjangoLoaddataDataDialog import DjangoLoaddataDataDialog + title = self.tr("Load Data") try: @@ -3047,8 +3038,6 @@ except DjangoNoSiteSelectedError: return - from .DjangoLoaddataDataDialog import DjangoLoaddataDataDialog - dlg = DjangoLoaddataDataDialog(self, self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: fixtures, excludes, appLabel, ignore = dlg.getData() @@ -3079,6 +3068,8 @@ @param deprecation flag indicating to test for deprecation warnings @type bool """ + from .DjangoTestDataDialog import DjangoTestDataDialog + consoleCmd = self.__isSpawningConsole( self.__plugin.getPreferences("ConsoleCommandNoClose") )[1] @@ -3088,8 +3079,6 @@ except DjangoNoSiteSelectedError: return - from .DjangoTestDataDialog import DjangoTestDataDialog - dlg = DjangoTestDataDialog( self, self.__plugin.getPreferences("KeepTestDatabase"), self.__ui ) @@ -3131,12 +3120,12 @@ Private slot to run a development server with data from a set of fixtures. """ + from .DjangoRunTestServerDataDialog import DjangoRunTestServerDataDialog + consoleCmd = self.__isSpawningConsole( self.__plugin.getPreferences("ConsoleCommand") )[1] if consoleCmd: - from .DjangoRunTestServerDataDialog import DjangoRunTestServerDataDialog - dlg = DjangoRunTestServerDataDialog(self, self.__ui) if dlg.exec() == QDialog.DialogCode.Accepted: fixtures = dlg.getData() @@ -3173,7 +3162,7 @@ EricMessageBox.critical( None, self.tr("Process Generation Error"), - self.tr("The Django test server could not be" " started."), + self.tr("The Django test server could not be started."), ) def __testServerProcFinished(self): @@ -3222,7 +3211,7 @@ EricMessageBox.critical( None, self.tr("Process Generation Error"), - self.tr("The Django process could not be" " started."), + self.tr("The Django process could not be started."), ) def __createSuperUser(self): @@ -3360,9 +3349,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3393,9 +3380,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3432,7 +3417,7 @@ @param filenames list of filenames @type list of str """ - title = self.tr("Updating message catalogs (keeping obsolete" " messages)") + title = self.tr("Updating message catalogs (keeping obsolete messages)") try: wd = self.__sitePath() @@ -3440,9 +3425,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3471,7 +3454,7 @@ if res: dia.exec() - def updateCatalogs(self, filenames): + def updateCatalogs(self, filenames): # noqa: U100 """ Public method to update the message catalogs. @@ -3493,9 +3476,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3506,14 +3487,14 @@ if res: dia.exec() - def updateCatalogsWithObsolete(self, filenames): + def updateCatalogsWithObsolete(self, filenames): # noqa: U100 """ Public method to update the message catalogs keeping obsolete messages. @param filenames list of filenames (not used) @type list of str """ - title = self.tr("Updating message catalogs (keeping obsolete" " messages)") + title = self.tr("Updating message catalogs (keeping obsolete messages)") args = [] args.append(self.__getPythonExecutable()) @@ -3527,9 +3508,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3555,9 +3534,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3594,7 +3571,7 @@ if fullName.endswith(".mo"): self.__ericProject.appendFile(fullName) - def compileCatalogs(self, filenames): + def compileCatalogs(self, filenames): # noqa: U100 """ Public method to compile the message catalogs. @@ -3616,9 +3593,7 @@ EricMessageBox.warning( None, title, - self.tr( - "No current site selected or no site created yet." " Aborting..." - ), + self.tr("No current site selected or no site created yet. Aborting..."), ) return @@ -3654,7 +3629,7 @@ None, self.tr("Process Generation Error"), self.tr( - "The translations editor process ({0}) could" " not be started." + "The translations editor process ({0}) could not be started." ).format(os.path.basename(editor)), ) @@ -3666,13 +3641,13 @@ """ Private slot to inspect the project for common problems. """ + from .DjangoCheckOptionsDialog import DjangoCheckOptionsDialog + try: path = self.__sitePath() except DjangoNoSiteSelectedError: return - from .DjangoCheckOptionsDialog import DjangoCheckOptionsDialog - dlg = DjangoCheckOptionsDialog( self.__getPythonExecutable(), path,