diff -r e440aaf179ce -r 64157aeb0312 src/eric7/QScintilla/Editor.py --- a/src/eric7/QScintilla/Editor.py Wed Dec 20 19:28:22 2023 +0100 +++ b/src/eric7/QScintilla/Editor.py Thu Dec 21 12:03:40 2023 +0100 @@ -146,12 +146,14 @@ settingsRead = pyqtSignal() mouseDoubleClick = pyqtSignal(QPoint, Qt.MouseButton) + # TODO: convert to an enum.Enum WarningCode = 1 WarningPython = 2 WarningStyle = 3 WarningInfo = 4 WarningError = 5 + # TODO: convert to an enum.IntEnum (also in Assistant plugin) # Autocompletion icon definitions ClassID = 1 ClassProtectedID = 2 @@ -746,8 +748,9 @@ Private method to generate a dummy filename for binding a lexer. @param line0 first line of text to use in the generation process - (string) - @return dummy file name to be used for binding a lexer (string) + @type str + @return dummy file name to be used for binding a lexer + @rtype str """ bindName = "" line0 = line0.lower() @@ -821,8 +824,10 @@ """ Public method to get a reference to the main context menu or a submenu. - @param menuName name of the menu (string) - @return reference to the requested menu (QMenu) or None + @param menuName name of the menu + @type str + @return reference to the requested menu or None + @rtype QMenu """ try: return self.__menus[menuName] @@ -833,7 +838,8 @@ """ Public method to check the miniMenu flag. - @return flag indicating a minimized context menu (boolean) + @return flag indicating a minimized context menu + @rtype bool """ return self.miniMenu @@ -1503,7 +1509,8 @@ """ Public method to export the file. - @param exporterFormat format the file should be exported into (string) + @param exporterFormat format the file should be exported into + @type str """ if exporterFormat: exporter = Exporters.getExporter(exporterFormat, self) @@ -1543,7 +1550,8 @@ """ Private method to select a specific pygments lexer. - @return name of the selected pygments lexer (string) + @return name of the selected pygments lexer + @rtype str """ from pygments.lexers import get_all_lexers # __IGNORE_WARNING_I102__ @@ -1571,7 +1579,8 @@ """ Private method to handle the selection of a lexer language. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ if act == self.noLanguageAct: self.__resetLanguage() @@ -1594,8 +1603,10 @@ """ Private method handling a change of a connected editor's language. - @param language language to be set (string) - @param propagate flag indicating to propagate the change (boolean) + @param language language to be set + @type str + @param propagate flag indicating to propagate the change + @type bool """ if language == "": self.__resetLanguage(propagate=propagate) @@ -1615,7 +1626,8 @@ """ Private method used to reset the language selection. - @param propagate flag indicating to propagate the change (boolean) + @param propagate flag indicating to propagate the change + @type bool """ if self.lexer_ is not None and ( self.lexer_.lexer() == "container" or self.lexer_.lexer() is None @@ -1649,11 +1661,15 @@ Public method to set a lexer language. @param filename filename used to determine the associated lexer - language (string) + language + @type str @param initTextDisplay flag indicating an initialization of the text - display is required as well (boolean) - @param propagate flag indicating to propagate the change (boolean) - @param pyname name of the pygments lexer to use (string) + display is required as well + @type bool + @param propagate flag indicating to propagate the change + @type bool + @param pyname name of the pygments lexer to use + @type str """ # clear all warning and syntax error markers self.clearSyntaxError() @@ -1716,7 +1732,8 @@ """ Private method to handle the selection of an encoding. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ encoding = act.data() self.setModified(True) @@ -1751,8 +1768,10 @@ """ Private method to calculate the normalized encoding string. - @param encoding encoding to be normalized (string) - @return normalized encoding (string) + @param encoding encoding to be normalized + @type str + @return normalized encoding + @rtype str """ if not encoding: encoding = self.encoding @@ -1773,7 +1792,8 @@ """ Private method to handle the selection of an eol type. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ eol = act.data() self.setEolModeByEolString(eol) @@ -1997,7 +2017,8 @@ """ Public method to retrieve a reference to the lexer object. - @return the lexer object (Lexer) + @return the lexer object + @rtype Lexer """ return self.lexer_ @@ -2006,10 +2027,13 @@ Public method to retrieve the language of the editor. @param normalized flag indicating to normalize some Pygments - lexer names (boolean) + lexer names + @type bool @param forPygments flag indicating to normalize some lexer - names for Pygments (boolean) - @return language of the editor (string) + names for Pygments + @type bool + @return language of the editor + @rtype str """ if self.apiLanguage == "Guessed" or self.apiLanguage.startswith("Pygments|"): lang = self.lexer_.name() @@ -2060,7 +2084,8 @@ """ Public method to retrieve a reference to the completer object. - @return the completer object (CompleterBase) + @return the completer object + @rtype CompleterBase """ return self.completer @@ -2140,7 +2165,8 @@ """ Public method to set the display string for an unnamed editor. - @param noName display string for this unnamed editor (string) + @param noName display string for this unnamed editor + @type str """ self.noName = noName @@ -2148,7 +2174,8 @@ """ Public method to get the display string for an unnamed editor. - @return display string for this unnamed editor (string) + @return display string for this unnamed editor + @rtype str """ return self.noName @@ -2156,7 +2183,8 @@ """ Public method to return the name of the file being displayed. - @return filename of the displayed file (string) + @return filename of the displayed file + @rtype str """ return self.fileName @@ -2164,7 +2192,8 @@ """ Public method to return the type of the file being displayed. - @return type of the displayed file (string) + @return type of the displayed file + @rtype str """ return self.filetype @@ -2174,7 +2203,8 @@ eflag: marker. @return type of the displayed file, if set by an eflag: marker or an - empty string (string) + empty string + @rtype str """ if self.filetypeByFlag: return self.filetype @@ -2185,7 +2215,8 @@ """ Public method to determine the file type using various tests. - @return type of the displayed file or an empty string (string) + @return type of the displayed file or an empty string + @rtype str """ ftype = self.filetype if not ftype: @@ -2203,7 +2234,8 @@ """ Public method to return the current encoding. - @return current encoding (string) + @return current encoding + @rtype str """ return self.encoding @@ -2212,7 +2244,8 @@ Private method to return the Python main version or 0 if it's not a Python file at all. - @return Python version or 0 if it's not a Python file (int) + @return Python version or 0 if it's not a Python file + @rtype int """ return PythonUtilities.determinePythonVersion(self.fileName, self.text(0), self) @@ -2220,7 +2253,8 @@ """ Public method to return a flag indicating a Python (2 or 3) file. - @return flag indicating a Python3 file (boolean) + @return flag indicating a Python3 file + @rtype bool """ return self.__getPyVersion() == 3 @@ -2228,7 +2262,8 @@ """ Public method to return a flag indicating a Python3 file. - @return flag indicating a Python3 file (boolean) + @return flag indicating a Python3 file + @rtype bool """ return self.__getPyVersion() == 3 @@ -2260,7 +2295,8 @@ """ Public method to return a flag indicating a Ruby file. - @return flag indicating a Ruby file (boolean) + @return flag indicating a Ruby file + @rtype bool """ if self.filetype == "Ruby": return True @@ -2283,7 +2319,8 @@ """ Public method to return a flag indicating a Javascript file. - @return flag indicating a Javascript file (boolean) + @return flag indicating a Javascript file + @rtype bool """ if self.filetype == "JavaScript": return True @@ -2324,10 +2361,13 @@ """ Public method to highlight [or de-highlight] a particular line. - @param line line number to highlight (integer) + @param line line number to highlight + @type int @param error flag indicating whether the error highlight should be - used (boolean) - @param syntaxError flag indicating a syntax error (boolean) + used + @type bool + @param syntaxError flag indicating a syntax error + @type bool """ if line is None: self.lastHighlight = None @@ -2354,7 +2394,8 @@ """ Public method to return the position of the highlight bar. - @return line number of the highlight bar (integer) + @return line number of the highlight bar + @rtype int """ if self.lastHighlight is not None: return self.markerLine(self.lastHighlight) @@ -2381,17 +2422,26 @@ """ Private method to handle changes of the number of lines. - @param pos start position of change (integer) - @param mtype flags identifying the change (integer) - @param text text that is given to the Undo system (string) - @param length length of the change (integer) - @param linesAdded number of added/deleted lines (integer) - @param line line number of a fold level or marker change (integer) - @param foldNow new fold level (integer) - @param foldPrev previous fold level (integer) + @param pos start position of change + @type int + @param mtype flags identifying the change + @type int + @param text text that is given to the Undo system + @type str + @param length length of the change + @type int + @param linesAdded number of added/deleted lines + @type int + @param line line number of a fold level or marker change + @type int + @param foldNow new fold level + @type int + @param foldPrev previous fold level + @type int @param token ??? + @type int @param annotationLinesAdded number of added/deleted annotation lines - (integer) + @type int """ if mtype & (self.SC_MOD_INSERTTEXT | self.SC_MOD_DELETETEXT): # 1. set/reset the autosave timer @@ -2506,7 +2556,8 @@ Note: This doesn't clear the breakpoint in the debugger, it just deletes it from the editor internal list of breakpoints. - @param line line number of the breakpoint (integer) + @param line line number of the breakpoint + @type int """ if self.inLinesChanged: return @@ -2522,9 +2573,11 @@ """ Public method to set a new breakpoint and its properties. - @param line line number of the breakpoint (integer) - @param properties properties for the breakpoint (tuple) + @param line line number of the breakpoint + @type int + @param properties properties for the breakpoint (condition, temporary flag, enabled flag, ignore count) + @type tuple of (str, bool, bool, int) """ if not properties[2]: marker = self.dbreakpoint @@ -2543,8 +2596,10 @@ """ Private method to toggle a breakpoint. - @param line line number of the breakpoint (integer) - @param temporary flag indicating a temporary breakpoint (boolean) + @param line line number of the breakpoint + @type int + @param temporary flag indicating a temporary breakpoint + @type bool """ for handle in self.breaks: if self.markerLine(handle) == line - 1: @@ -2566,8 +2621,10 @@ """ Private method to add a new breakpoint. - @param line line number of the breakpoint (integer) - @param temporary flag indicating a temporary breakpoint (boolean) + @param line line number of the breakpoint + @type int + @param temporary flag indicating a temporary breakpoint + @type bool """ if self.fileName and self.isPyFile(): linestarts = PythonDisViewer.linestarts(self.text()) @@ -2598,7 +2655,8 @@ """ Private method to toggle a breakpoints enabled status. - @param line line number of the breakpoint (integer) + @param line line number of the breakpoint + @type int """ for handle in self.breaks: if self.markerLine(handle) == line - 1: @@ -2613,7 +2671,8 @@ Public method to check for the presence of a breakpoint at the current line. - @return flag indicating the presence of a breakpoint (boolean) + @return flag indicating the presence of a breakpoint + @rtype bool """ line, _ = self.getCursorPosition() return self.markersAtLine(line) & self.breakpointMask != 0 @@ -2622,7 +2681,8 @@ """ Public method to get the lines containing a breakpoint. - @return list of lines containing a breakpoint (list of integer) + @return list of lines containing a breakpoint + @rtype list of int """ lines = [] line = -1 @@ -2638,7 +2698,8 @@ """ Public method to check for the presence of breakpoints. - @return flag indicating the presence of breakpoints (boolean) + @return flag indicating the presence of breakpoints + @rtype bool """ return len(self.breaks) > 0 @@ -2800,7 +2861,8 @@ """ Public method to toggle a bookmark. - @param line line number of the bookmark (integer) + @param line line number of the bookmark + @type int """ for handle in self.bookmarks: if self.markerLine(handle) == line - 1: @@ -2819,7 +2881,7 @@ Public method to retrieve the bookmarks. @return sorted list of all lines containing a bookmark - (list of integer) + @rtype list of int """ bmlist = [] for handle in self.bookmarks: @@ -2832,7 +2894,8 @@ """ Public method to get the lines containing a bookmark. - @return list of lines containing a bookmark (list of integer) + @return list of lines containing a bookmark + @rtype list of int """ lines = [] line = -1 @@ -2848,7 +2911,8 @@ """ Public method to check for the presence of bookmarks. - @return flag indicating the presence of bookmarks (boolean) + @return flag indicating the presence of bookmarks + @rtype bool """ return len(self.bookmarks) > 0 @@ -2976,7 +3040,7 @@ Private slot to generate a print preview. @param printer reference to the printer object - (QScintilla.Printer.Printer) + @type QScintilla.Printer.Printer """ printer.printRange(self) @@ -2988,7 +3052,8 @@ """ Public method to get the lines containing a task. - @return list of lines containing a task (list of integer) + @return list of lines containing a task + @rtype list of int """ lines = [] line = -1 @@ -3004,7 +3069,8 @@ """ Public method to determine, if this editor contains any task markers. - @return flag indicating the presence of task markers (boolean) + @return flag indicating the presence of task markers + @rtype bool """ return self.__hasTaskMarkers @@ -3095,9 +3161,12 @@ """ Private method to create a pixmap for the change markers. - @param key key of the color to use (string) - @param size size of the pixmap (integer) - @return create pixmap (QPixmap) + @param key key of the color to use + @type str + @param size size of the pixmap + @type int + @return create pixmap + @rtype QPixmap """ pixmap = QPixmap(size, size) pixmap.fill(Qt.GlobalColor.transparent) @@ -3218,7 +3287,8 @@ """ Public method to get the lines containing a change. - @return list of lines containing a change (list of integer) + @return list of lines containing a change + @rtype list of int """ lines = [] line = -1 @@ -3234,7 +3304,8 @@ """ Public method to determine, if this editor contains any change markers. - @return flag indicating the presence of change markers (boolean) + @return flag indicating the presence of change markers + @rtype bool """ return self.__hasChangeMarkers @@ -3284,7 +3355,8 @@ """ Private method to extract flags and process them. - @return list of change flags (list of string) + @return list of change flags + @rtype list of str """ txt = self.text() flags = Utilities.extractFlags(txt) @@ -3316,7 +3388,8 @@ """ Public method to check dirty status and open a message window. - @return flag indicating successful reset of the dirty flag (boolean) + @return flag indicating successful reset of the dirty flag + @rtype bool """ if self.isModified(): fn = self.fileName @@ -3527,8 +3600,10 @@ """ Private method to get the name of the file to be saved. - @param path directory to save the file in (string) - @return file name (string) + @param path directory to save the file in + @type str + @return file name + @rtype str """ # save to project, if a project is loaded if self.project.isOpen(): @@ -3590,8 +3665,10 @@ """ Public method to save a copy of the file. - @param path directory to save the file in (string) - @return flag indicating success (boolean) + @param path directory to save the file in + @type str + @return flag indicating success + @rtype bool """ fn = self.__getSaveFileName(path) if not fn: @@ -3608,9 +3685,12 @@ """ Public method to save the text to a file. - @param saveas flag indicating a 'save as' action (boolean) - @param path directory to save the file in (string) - @return flag indicating success (boolean) + @param saveas flag indicating a 'save as' action + @type bool + @param path directory to save the file in + @type str + @return flag indicating success + @rtype bool """ if not saveas and ( not self.isModified() or FileSystemUtilities.isRemoteFileName(self.fileName) @@ -3744,7 +3824,8 @@ """ Public method to handle the editorRenamed signal. - @param fn filename to be set for the editor (string). + @param fn filename to be set for the editor + @type str """ self.__clearBreakpoints(fn) @@ -3930,9 +4011,12 @@ """ Public method to get the word to the left of a position. - @param line number of line to look at (int) - @param index position to look at (int) - @return the word to the left of that position (string) + @param line number of line to look at + @type int + @param index position to look at + @type int + @return the word to the left of that position + @rtype str """ return self.getWord(line, index, 1) @@ -3940,9 +4024,12 @@ """ Public method to get the word to the right of a position. - @param line number of line to look at (int) - @param index position to look at (int) - @return the word to the right of that position (string) + @param line number of line to look at + @type int + @param index position to look at + @type int + @return the word to the right of that position + @rtype str """ return self.getWord(line, index, 2) @@ -3950,7 +4037,8 @@ """ Public method to get the word at the current position. - @return the word at that current position (string) + @return the word at that current position + @rtype str """ line, index = self.getCursorPosition() return self.getWord(line, index) @@ -3960,7 +4048,7 @@ Public method to get the word boundaries at the current position. @return tuple with start and end indexes of the current word - (integer, integer) + @rtype tuple of (int, int) """ line, index = self.getCursorPosition() return self.getWordBoundaries(line, index) @@ -3969,8 +4057,10 @@ """ Public method to select the word at a position. - @param line number of line to look at (int) - @param index position to look at (int) + @param line number of line to look at + @type int + @param index position to look at + @type int """ start, end = self.getWordBoundaries(line, index) self.setSelection(line, start, line, end) @@ -3987,9 +4077,11 @@ Private method to get the character to the left of the current position in the current line. - @param pos position to get character at (integer) - @return requested character or "", if there are no more (string) and - the next position (i.e. pos - 1) + @param pos position to get character at + @type int + @return requested character or "", if there are no more and the next position + (i.e. pos - 1) + @rtype tuple of (str, int) """ if pos <= 0: return "", pos @@ -4009,8 +4101,10 @@ next search operation. @param selectionOnly flag indicating that only selected text should be - returned (boolean) - @return selection or current word (string) + returned + @type bool + @return selection or current word + @rtype str """ if self.hasSelectedText(): text = self.selectedText() @@ -4031,8 +4125,10 @@ """ Public method to set a search indicator for the given range. - @param startPos start position of the indicator (integer) - @param indicLength length of the indicator (integer) + @param startPos start position of the indicator + @type int + @param indicLength length of the indicator + @type int """ self.setIndicatorRange(self.searchIndicator, startPos, indicLength) line = self.lineIndexFromPosition(startPos)[0] @@ -4105,7 +4201,8 @@ """ Public method to get the lines containing a search indicator. - @return list of lines containing a search indicator (list of integer) + @return list of lines containing a search indicator + @rtype list of int """ return self.__searchIndicatorLines[:] @@ -4168,9 +4265,12 @@ Private method to check, if the given line is a comment line as produced by the configured comment rules. - @param line text of the line to check (string) - @param commentStr comment string to check against (string) - @return flag indicating a commented line (boolean) + @param line text of the line to check + @type str + @param commentStr comment string to check against + @type str + @return flag indicating a commented line + @rtype bool """ if Preferences.getEditor("CommentColumn0"): return line.startswith(commentStr) @@ -4709,9 +4809,10 @@ """ Private method to indent or unindent the current line. - @param indent flag indicating an indent operation (boolean) - <br />If the flag is true, an indent operation is performed. - Otherwise the current line is unindented. + @param indent flag indicating an indent operation + <br />If the flag is true, an indent operation is performed. + Otherwise the current line is unindented. + @type bool """ line, index = self.getCursorPosition() self.beginUndoAction() @@ -4729,9 +4830,10 @@ """ Private method to indent or unindent the current selection. - @param indent flag indicating an indent operation (boolean) - <br />If the flag is true, an indent operation is performed. - Otherwise the current line is unindented. + @param indent flag indicating an indent operation + <br />If the flag is true, an indent operation is performed. + Otherwise the current line is unindented. + @type bool """ if not self.hasSelectedText(): return @@ -4848,7 +4950,8 @@ """ Public method to check, if a last edit position is available. - @return flag indicating availability (boolean) + @return flag indicating availability + @rtype bool """ return self.__lastEditPosition is not None @@ -4863,7 +4966,8 @@ """ Public method to go to the next Python method or class definition. - @param goUp flag indicating the move direction (boolean) + @param goUp flag indicating the move direction + @type bool """ if self.isPyFile() or self.isRubyFile(): lineNo = self.getCursorPosition()[0] @@ -5412,7 +5516,8 @@ """ Public method to check for API availablity. - @return flag indicating autocompletion from APIs is available (boolean) + @return flag indicating autocompletion from APIs is available + @rtype bool """ return self.acAPI @@ -5447,7 +5552,7 @@ Public method to enable/disable autocompletion. @param enable flag indicating the desired autocompletion status - (boolean) + @type bool """ if enable: autoCompletionSource = Preferences.getEditor("AutoCompletionSource") @@ -5523,8 +5628,10 @@ Private method to check, if a character is an autocompletion start character. - @param ch character to be checked (one character string) - @return flag indicating the result (boolean) + @param ch character to be checked + @type str + @return flag indicating the result + @rtype bool """ if self.lexer_ is None: return False @@ -5612,8 +5719,9 @@ Public method to start auto-completion. @param auto flag indicating a call from the __charAdded method - (boolean) - @param context flag indicating to complete a context (boolean) + @type bool + @param context flag indicating to complete a context + @type bool """ if auto and not Preferences.getEditor("AutoCompletionEnabled"): # auto-completion is disabled @@ -5664,7 +5772,7 @@ Private method to start auto-completion via plug-ins. @param auto flag indicating a call from the __charAdded method - (boolean) + @type bool @param context flag indicating to complete a context @type bool or None """ @@ -5835,7 +5943,7 @@ Public method to test the dynamic auto-completion availability. @return flag indicating the availability of dynamic auto-completion - (boolean) + @rtype bool """ return ( self.acAPI @@ -5902,7 +6010,8 @@ """ Public method to test the calltips availability. - @return flag indicating the availability of calltips (boolean) + @return flag indicating the availability of calltips + @rtype bool """ return self.acAPI or bool(self.__ctHookFunctions) @@ -6028,9 +6137,12 @@ """ Private method to calculate an adjusted position for showing calltips. - @param ctshift amount the calltip shall be shifted (integer) - @param pos position into the text (integer) - @return new position for the calltip (integer) + @param ctshift amount the calltip shall be shifted + @type int + @param pos position into the text + @type int + @return new position for the calltip + @rtype int """ ct = pos if ctshift: @@ -6063,8 +6175,10 @@ """ Private method to calculate the margin number based on a x position. - @param xPos x position (integer) + @param xPos x position + @type int @return margin number (integer, -1 for no margin) + @rtype int """ width = 0 for margin in range(5): @@ -6366,7 +6480,8 @@ Private method to handle the rereading of the file with a selected encoding. - @param act reference to the action that was triggered (QAction) + @param act reference to the action that was triggered + @type QAction """ encoding = act.data() self.readFile(self.fileName, encoding=encoding) @@ -6505,7 +6620,8 @@ """ Private method to check the autosave flags. - @return flag indicating this editor should be saved (boolean) + @return flag indicating this editor should be saved + @rtype bool """ return ( bool(self.fileName) @@ -6785,7 +6901,8 @@ """ Public method to get the lines containing a coverage marker. - @return list of lines containing a coverage marker (list of integer) + @return list of lines containing a coverage marker + @rtype list of int """ lines = [] line = -1 @@ -6801,7 +6918,8 @@ """ Public method to test, if there are coverage markers. - @return flag indicating the presence of coverage markers (boolean) + @return flag indicating the presence of coverage markers + @rtype bool """ return len(self.notcoveredMarkers) > 0 @@ -6965,7 +7083,8 @@ """ Public method to get the lines containing a syntax error. - @return list of lines containing a syntax error (list of integer) + @return list of lines containing a syntax error + @rtype list of int """ lines = [] line = -1 @@ -6981,7 +7100,8 @@ """ Public method to check for the presence of syntax errors. - @return flag indicating the presence of syntax errors (boolean) + @return flag indicating the presence of syntax errors + @rtype bool """ return len(self.syntaxerrors) > 0 @@ -7123,7 +7243,8 @@ """ Public method to get the lines containing a warning. - @return list of lines containing a warning (list of integer) + @return list of lines containing a warning + @rtype list of int """ lines = [] line = -1 @@ -7139,7 +7260,8 @@ """ Public method to check for the presence of warnings. - @return flag indicating the presence of warnings (boolean) + @return flag indicating the presence of warnings + @rtype bool """ return len(self._warnings) > 0 @@ -7221,6 +7343,7 @@ @param warningKind kind of warning to clear (Editor.WarningCode, Editor.WarningPython, Editor.WarningStyle) + @type int """ for handle in list(self._warnings): issues = [] @@ -7339,7 +7462,8 @@ """ Private method to set the annotations for the given line. - @param line number of the line that needs annotation (integer) + @param line number of the line that needs annotation + @type int """ if hasattr(QsciScintilla, "annotate"): warningAnnotations = [] @@ -7483,7 +7607,8 @@ Private method to select a macro name from the list of macros. @return Tuple of macro name and a flag, indicating, if the user - pressed ok or canceled the operation. (string, boolean) + pressed ok or canceled the operation. + @rtype tuple of (str, bool) """ qs = [] for s in self.macros: @@ -7673,7 +7798,8 @@ ViewManager.closeEditor, which in turn calls our closeIt method. - @return flag indicating a successful close of the editor (boolean) + @return flag indicating a successful close of the editor + @rtype bool """ return self.vm.closeEditor(self) @@ -7959,6 +8085,7 @@ @param bForce True to force change, False to only update and emit signal if there was an attribute change. + @type bool """ if self.fileName == "" or not FileSystemUtilities.isPlainFileName( self.fileName @@ -8095,7 +8222,8 @@ """ Public method to set/reset a monospaced font. - @param on flag to indicate usage of a monospace font (boolean) + @param on flag to indicate usage of a monospace font + @type bool """ if on: if not self.lexer_: @@ -8127,7 +8255,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: @@ -8139,7 +8268,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.accept() @@ -8150,7 +8280,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 @@ -8162,7 +8293,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(): for url in event.mimeData().urls(): @@ -8192,7 +8324,8 @@ """ Private method used to setup the Resources context sub menu. - @return reference to the generated menu (QMenu) + @return reference to the generated menu + @rtype QMenu """ menu = QMenu(self.tr("Resources")) @@ -8425,6 +8558,7 @@ Public method to perform a simple editor command. @param cmd the scintilla command to be performed + @type int """ if cmd == QsciScintilla.SCI_TAB: try: @@ -8486,9 +8620,11 @@ """ Private method to apply a template by name. - @param templateName name of the template to apply (string) + @param templateName name of the template to apply + @type str @param language name of the language (group) to get the template - from (string) + from + @type str """ try: templateViewer = ericApp().getObject("TemplateViewer") @@ -8575,9 +8711,12 @@ """ Private method to set the spell checking language. - @param language spell checking language to be set (string) - @param pwl name of the personal/project word list (string) - @param pel name of the personal/project exclude list (string) + @param language spell checking language to be set + @type str + @param pwl name of the personal/project word list + @type str + @param pel name of the personal/project exclude list + @type str """ if self.spell and self.spell.getLanguage() != language: self.spell.setLanguage(language, pwl=pwl, pel=pel) @@ -8818,7 +8957,7 @@ @return tuple indicating, if the editor is sharable, the sharing status, if it is inside a locally initiated shared edit session and if it is inside a remotely initiated shared edit session - (boolean, boolean, boolean, boolean) + @rtype tuple of (bool, bool, bool, bool) """ return ( ( @@ -8835,7 +8974,8 @@ """ Public method to handle a change of the connected state. - @param connected flag indicating the connected state (boolean) + @param connected flag indicating the connected state + @type bool """ if not connected: self.__inRemoteSharedEdit = False @@ -8849,7 +8989,8 @@ """ Public method to set the shared status of the editor. - @param share flag indicating the share status (boolean) + @param share flag indicating the share status + @type bool """ self.__isShared = share if not share: @@ -8886,7 +9027,8 @@ """ Public method to cancel a shared edit session for the editor. - @param send flag indicating to send the CancelEdit command (boolean) + @param send flag indicating to send the CancelEdit command + @type bool """ self.__inSharedEdit = False self.__savedText = "" @@ -8897,8 +9039,10 @@ """ Private method to send an editor command to remote editors. - @param token command token (string) - @param args arguments for the command (string) + @param token command token + @type str + @param args arguments for the command + @type str """ if self.vm.isConnected(): msg = "" @@ -8934,7 +9078,8 @@ """ Private method to dispatch received commands. - @param command command to be processed (string) + @param command command to be processed + @type str """ token, argsString = command.split(Editor.Separator, 1) if token == Editor.StartEditToken: @@ -8977,9 +9122,12 @@ Private method to determine change commands to convert old text into new text. - @param old old text (string) - @param new new text (string) - @return commands to change old into new (string) + @param old old text + @type str + @param new new text + @type str + @return commands to change old into new + @rtype str """ oldL = old.splitlines() newL = new.splitlines() @@ -9109,7 +9257,8 @@ """ Private slot to search the next occurrence of the current word. - @param forward flag indicating the search direction (boolean) + @param forward flag indicating the search direction + @type bool """ self.hideFindIndicator() line, index = self.getCursorPosition()