diff -r 2fe91fe443dd -r 328f3ec4b77a src/eric7/UI/UserInterface.py --- a/src/eric7/UI/UserInterface.py Thu Dec 21 15:46:22 2023 +0100 +++ b/src/eric7/UI/UserInterface.py Thu Dec 21 19:50:01 2023 +0100 @@ -138,6 +138,7 @@ Private method used to write data. @param n max number of bytes to write + @type int """ if n: line = self.buffer[:n] @@ -152,7 +153,7 @@ Private method returning number of characters to write. @return number of characters buffered or length of buffered line - (integer) + @rtype int """ return self.buffer.rfind("\n") + 1 @@ -167,6 +168,7 @@ Public method used to write data. @param s data to be written (it must support the str-method) + @type Any """ self.buffer += str(s) self.__nWrite(self.__bufferedWrite()) @@ -1558,8 +1560,9 @@ """ Private method to open the last file, project or multiproject. - @param startupType type of startup requested (string, one of + @param startupType type of startup requested (one of "Nothing", "File", "Project", "MultiProject" or "Session") + @type str """ startupTypeMapping = { "Nothing": 0, @@ -1744,8 +1747,10 @@ """ Private method to create a dock window with common properties. - @param name object name of the new dock window (string) - @return the generated dock window (QDockWindow) + @param name object name of the new dock window + @type str + @return the generated dock window + @rtype QDockWindow """ dock = QDockWidget() dock.setObjectName(name) @@ -1761,10 +1766,14 @@ Private method to configure the dock window created with __createDockWindow(). - @param dock the dock window (QDockWindow) - @param where dock area to be docked to (Qt.DockWidgetArea) - @param widget widget to be shown in the dock window (QWidget) - @param caption caption of the dock window (string) + @param dock the dock window + @type QDockWindow + @param where dock area to be docked to + @type Qt.DockWidgetArea + @param widget widget to be shown in the dock window + @type QWidget + @param caption caption of the dock window + @type str """ if caption is None: caption = "" @@ -1777,8 +1786,10 @@ """ Private method to set the caption of the Main Window. - @param editor filename to be displayed (string) - @param project project name to be displayed (string) + @param editor filename to be displayed + @type str + @param project project name to be displayed + @type str """ if editor is not None and self.captionShowsFilename: self.capEditor = FileSystemUtilities.compactPath( @@ -4567,10 +4578,13 @@ """ Public slot to show the email dialog in a given mode. - @param mode mode of the email dialog (string, "bug" or "feature") - @param attachFile name of a file to attach to the email (string) + @param mode mode of the email dialog ("bug" or "feature") + @type str + @param attachFile name of a file to attach to the email + @type str @param deleteAttachFile flag indicating to delete the attached file - after it has been sent (boolean) + after it has been sent + @type bool """ from .EmailDialog import EmailDialog @@ -4602,11 +4616,14 @@ """ Private slot to show the system email dialog. - @param mode mode of the email dialog (string, "bug" or "feature") + @param mode mode of the email dialog ("bug" or "feature") + @type str @param attachFile name of a file to put into the body of the - email (string) + email + @type str @param deleteAttachFile flag indicating to delete the file after - it has been read (boolean) + it has been read + @type bool """ address = FeatureAddress if mode == "feature" else BugAddress subject = "[eric] " @@ -4646,7 +4663,8 @@ """ Private method to check, if an error log file exists. - @return flag indicating the existence of an error log file (boolean) + @return flag indicating the existence of an error log file + @rtype bool """ logFile = os.path.join(Globals.getConfigDir(), self.ErrorLogFileName) return os.path.exists(logFile) @@ -4710,9 +4728,11 @@ """ Public method to add actions to the list of actions. - @param actions list of actions to be added (list of EricAction) + @param actions list of actions to be added + @type list of EricAction @param actionType string denoting the action set to add to. It must be one of "ui" or "wizards". + @type str """ if actionType == "ui": self.actions.extend(actions) @@ -4723,9 +4743,11 @@ """ Public method to remove actions from the list of actions. - @param actions list of actions (list of EricAction) + @param actions list of actions + @type list of EricActio @param actionType string denoting the action set to remove from. It must be one of "ui" or "wizards". + @type str """ for act in actions: with contextlib.suppress(ValueError): @@ -4740,7 +4762,9 @@ @param actionType string denoting the action set to get. It must be one of "ui" or "wizards". - @return list of all actions (list of EricAction) + @type str + @return list of all actions + @rtype list of EricAction """ if actionType == "ui": return self.actions[:] @@ -4753,10 +4777,12 @@ """ Public method to get a reference to an action of a menu. - @param menuName name of the menu to search in (string) + @param menuName name of the menu to search in + @type str @param actionName object name of the action to search for - (string) - @return reference to the menu action (QAction) + @type str + @return reference to the menu action + @rtype QAction """ try: menu = self.__menus[menuName] @@ -4773,8 +4799,10 @@ """ Public method to get a reference to an action of the main menu. - @param menuName name of the menu to search in (string) - @return reference to the menu bar action (QAction) + @param menuName name of the menu to search in + @type str + @return reference to the menu bar action + @rtype QAction """ try: menu = self.__menus[menuName] @@ -4787,8 +4815,10 @@ """ Public method to get a reference to a specific menu. - @param name name of the menu (string) - @return reference to the menu (QMenu) + @param name name of the menu + @type str + @return reference to the menu + @rtype QMenu """ try: return self.__menus[name] @@ -4838,7 +4868,8 @@ """ Public method to unregister a toolbar. - @param name name of the toolbar (string). + @param name name of the toolbar + @type str """ if name in self.__toolbars: del self.__toolbars[name] @@ -4847,8 +4878,10 @@ """ Public method to get a reference to a specific toolbar. - @param name name of the toolbar (string) - @return reference to the toolbar entry (tuple of string and QToolBar) + @param name name of the toolbar + @type str + @return reference to the toolbar entry + @rtype tuple of (str, QToolBar) """ try: return self.__toolbars[name] @@ -4877,7 +4910,8 @@ """ Public method to get the locale of the IDE. - @return locale of the IDE (string or None) + @return locale of the IDE + @rtype str """ return self.locale @@ -5131,7 +5165,8 @@ """ Private slot to set the current tool group. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ self.toolGroupsMenuTriggered = True idx = act.data() @@ -5186,7 +5221,8 @@ """ Private method to populate a toolbars menu. - @param menu reference to the menu to be populated (QMenu) + @param menu reference to the menu to be populated + @type QMenu """ menu.clear() @@ -5207,7 +5243,8 @@ """ Public method to create the toolbars menu for Qt. - @return toolbars menu (QMenu) + @return toolbars menu + @rtype QMenu """ menu = QMenu(self) menu.triggered.connect(self.__TBPopupMenuTriggered) @@ -5227,7 +5264,8 @@ Private method to handle the toggle of a toolbar via the Window-> Toolbars submenu. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ name = act.data() if name: @@ -5254,7 +5292,8 @@ Private method to handle the toggle of a toolbar via the QMainWindow Toolbars popup menu. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ name = act.data() if name: @@ -5279,7 +5318,8 @@ Private slot to save the window geometries of the active profile. @param save flag indicating that the current profile should - be saved (boolean) + be saved + @type bool """ if self.currentProfile and save: # step 1: save the window geometries of the active profile @@ -5320,9 +5360,11 @@ """ Private slot to activate a view profile. - @param name name of the profile to be activated (string) + @param name name of the profile to be activated + @type str @param save flag indicating that the current profile should - be saved (boolean) + be saved + @type bool """ if self.currentProfile != name or not save: # step 1: save the active profile @@ -5440,7 +5482,8 @@ Private slot to activate the edit view profile. @param save flag indicating that the current profile should - be saved (boolean) + be saved + @type bool """ self.__activateViewProfile("edit", save) self.setEditProfileAct.setChecked(True) @@ -5451,7 +5494,8 @@ Public slot to activate the debug view profile. @param save flag indicating that the current profile should - be saved (boolean) + be saved + @type bool """ self.viewmanager.searchReplaceWidget().hide() self.__activateViewProfile("debug", save) @@ -5461,7 +5505,8 @@ """ Public method to get the current view profile. - @return the name of the current view profile (string) + @return the name of the current view profile + @rtype str """ return self.currentProfile @@ -5795,7 +5840,9 @@ Private method to toggle a workspace editor window. @param w reference to the workspace editor window - @return flag indicating, if the window was shown (boolean) + @type Editor + @return flag indicating, if the window was shown + @rtype bool """ if w.isHidden(): w.show() @@ -6098,7 +6145,8 @@ """ Private slot to start a custom viewer. - @param home full pathname of a file to display (string) + @param home full pathname of a file to display + @type str """ customViewer = Preferences.getHelp("CustomViewer") if not customViewer: @@ -6131,7 +6179,8 @@ """ Private slot to start the win help viewer to show *.chm files. - @param home full pathname of a file to display (string) + @param home full pathname of a file to display + @type str """ if home: proc = QProcess() @@ -6154,7 +6203,8 @@ """ Private slot to start the UI Previewer executable. - @param fn filename of the form to be previewed (string) + @param fn filename of the form to be previewed + @type str """ proc = QProcess() @@ -6208,9 +6258,9 @@ Private slot to start the Translation Previewer executable. @param fileNames filenames of forms and/or translations to be previewed - (list of strings) + @type list of str @param ignore flag indicating non existing files should be ignored - (boolean) + @type bool """ proc = QProcess() @@ -6345,7 +6395,8 @@ """ Private slot to show a SVG file in a dialog. - @param fn filename of the file to show (string) + @param fn filename of the file to show + @type str """ from eric7.Graphics.SvgDiagram import SvgDiagram @@ -6424,7 +6475,8 @@ """ Private slot to execute a particular tool. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ if self.toolGroupsMenuTriggered: # ignore actions triggered from the select tool group submenu @@ -6444,7 +6496,8 @@ """ Private slot to start an external tool process. - @param tool list of tool entries + @param tool dictionary of tool entries + @type dict """ proc = QProcess() procData = (None,) @@ -6529,8 +6582,10 @@ """ Private slot to handle the finished signal of a tool process. - @param exitCode exit code of the process (integer) - @param exitStatus exit status of the process (QProcess.ExitStatus) + @param exitCode exit code of the process + @type int + @param exitStatus exit status of the process + @type QProcess.ExitStatus """ exitedProcs = [] @@ -7037,7 +7092,8 @@ """ Private slot to start the eric web browser. - @param home full pathname of a file to display (string) + @param home full pathname of a file to display + @type str """ started = QDesktopServices.openUrl(QUrl(home)) if not started: @@ -7051,7 +7107,8 @@ """ Public slot to set the preferences. - @param pageName name of the configuration page to show (string) + @param pageName name of the configuration page to show + @type str """ from eric7.Preferences.ConfigurationDialog import ConfigurationDialog @@ -7439,7 +7496,8 @@ This primarily is here to set the currentProg variable. - @param fn filename to be set as current prog (string) + @param fn filename to be set as current prog + @type str """ # Delete the old program if there was one. if self.currentProg is not None: @@ -7463,7 +7521,8 @@ """ Private slot to handle the editorOpened signal. - @param fn filename of the opened editor (string) + @param fn filename of the opened editor + @type str """ self.wizardsMenuAct.setEnabled(len(self.__menus["wizards"].actions()) > 0) @@ -7482,6 +7541,7 @@ Private slot to check some actions for their enable/disable status. @param editor editor window + @type Editor """ fn = editor.getFileName() if editor else None @@ -7879,7 +7939,8 @@ """ Public slot to append text to the stdout log viewer tab. - @param s output to be appended (string) + @param s output to be appended + @type str """ self.appendStdout.emit(s) @@ -7887,7 +7948,8 @@ """ Public slot to append text to the stderr log viewer tab. - @param s output to be appended (string) + @param s output to be appended + @type str """ self.appendStderr.emit(s) @@ -7910,7 +7972,8 @@ Private slot to show a dialog to install a new plugin. @param pluginFileNames list of plugin files suggested for - installation list of strings + installation + @type list of str """ from eric7.PluginManager.PluginInstallDialog import PluginInstallDialog @@ -8009,7 +8072,8 @@ """ Protected method to handle the drag enter event. - @param event the drag enter event (QDragEnterEvent) + @param event the drag enter event + @type QDragEnterEvent """ self.inDragDrop = event.mimeData().hasUrls() if self.inDragDrop: @@ -8019,7 +8083,8 @@ """ Protected method to handle the drag move event. - @param event the drag move event (QDragMoveEvent) + @param event the drag move event + @type QDragMoveEvent """ if self.inDragDrop: event.acceptProposedAction() @@ -8028,7 +8093,8 @@ """ Protected method to handle the drag leave event. - @param event the drag leave event (QDragLeaveEvent) + @param event the drag leave event + @type QDragLeaveEvent """ if self.inDragDrop: self.inDragDrop = False @@ -8037,7 +8103,8 @@ """ Protected method to handle the drop event. - @param event the drop event (QDropEvent) + @param event the drop event + @type QDropEvent """ if event.mimeData().hasUrls(): event.acceptProposedAction() @@ -8067,7 +8134,8 @@ This event handler saves the preferences. - @param event close event (QCloseEvent) + @param event close event + @type QCloseEvent """ if self.__shutdown(): event.accept() @@ -8254,8 +8322,10 @@ """ Private slot to handle SSL errors. - @param reply reference to the reply object (QNetworkReply) - @param errors list of SSL errors (list of QSslError) + @param reply reference to the reply object + @type QNetworkReply + @param errors list of SSL errors + @type list of QSslError """ ignored = self.__sslErrorHandler.sslErrorsReply(reply, errors)[0] if ignored == EricSslErrorState.NOT_IGNORED: @@ -8324,10 +8394,12 @@ Public method to check, if the eric version is good compared to the required version. - @param required required version (string) - @param snapshot required snapshot version (string) - @return flag indicating, that the version is newer than the required - one (boolean) + @param required required version + @type str + @param snapshot required snapshot version + @type str + @return flag indicating, that the version is newer than the required one + @rtype bool """ if VersionOnly.startswith("@@"): # development version, always newer @@ -8363,8 +8435,10 @@ """ Private method to get the geometry of a floating windows. - @param w reference to the widget to be saved (QWidget) + @param w reference to the widget to be saved + @type QWidget @return list giving the widget's geometry and its visibility + @rtype list of [int, int, int, int, bool] """ s = w.size() p = w.pos() @@ -8388,7 +8462,8 @@ """ Protected method to handle the show event. - @param evt reference to the show event (QShowEvent) + @param evt reference to the show event + @type QShowEvent """ if self.__startup: if Preferences.getGeometry("MainMaximized"):