diff -r 2f70ca07f0af -r 4cd7e5a8b3cf src/eric7/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py --- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py Fri Dec 22 19:45:17 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py Sat Dec 23 15:40:23 2023 +0100 @@ -93,7 +93,9 @@ Constructor @param vcs reference to the vcs object - @param parent parent widget (QWidget) + @type Git + @param parent parent widget + @type QWidget """ super().__init__(parent) self.setupUi(self) @@ -404,7 +406,8 @@ """ Protected slot implementing a close event handler. - @param e close event (QCloseEvent) + @param e close event + @type QCloseEvent """ if ( self.__process is not None @@ -512,12 +515,14 @@ """ Private method to generate edge info for the give data. - @param commitId commit id to calculate edge info for (string) - @param parents list of parent commits (list of strings) + @param commitId commit id to calculate edge info for + @type str + @param parents list of parent commits + @type list of str @return tuple containing the column and color index for the given node and a list of tuples indicating the edges between the given node and its parents - (integer, integer, [(integer, integer, integer), ...]) + @rtype tuple of (int, int, [(int, int, int), ...]) """ if commitId not in self.__commitIds: # new head @@ -567,23 +572,29 @@ Private method to generate an icon containing the revision tree for the given data. - @param column column index of the revision (integer) + @param column column index of the revision + @type int @param bottomedges list of edges for the bottom of the node - (list of tuples of three integers) + @type list of [(int, int, int)] @param topedges list of edges for the top of the node - (list of tuples of three integers) - @param dotColor color to be used for the dot (QColor) + @type list of [(int, int, int)] + @param dotColor color to be used for the dot + @type QColor @param currentCommit flag indicating to draw the icon for the - current commit (boolean) - @return icon for the node (QIcon) + current commit + @type bool + @return icon for the node + @rtype QIcon """ def col2x(col, radius): """ Local function to calculate a x-position for a column. - @param col column number (integer) - @param radius radius of the indicator circle (integer) + @param col column number + @type int + @param radius radius of the indicator circle + @type int """ return int(1.2 * radius) * col + radius // 2 + 3 @@ -688,21 +699,35 @@ """ Private method to generate a log tree entry. - @param author author info (string) - @param date date info (string) - @param committer committer info (string) - @param commitDate commit date info (string) - @param subject subject of the log entry (string) - @param message text of the log message (list of strings) - @param commitId commit id info (string) - @param fullCommitId unabbreviated commit id info (string) + @param author author info + @type str + @param date date info + @type str + @param committer committer info + @type str + @param commitDate commit date info + @type str + @param subject subject of the log entry + @type str + @param message text of the log message + @type list of str + @param commitId commit id info + @type str + @param fullCommitId unabbreviated commit id info + @type str @param changedPaths list of dictionary objects containing info about the changed files/directories - @param parents list of parent revisions (list of integers) - @param refnames tags and branches of the commit (string) - @param authorMail author's email address (string) - @param committerMail committer's email address (string) - @return reference to the generated item (QTreeWidgetItem) + @type list of dict + @param parents list of parent revisions + @type list of int + @param refnames tags and branches of the commit + @type str + @param authorMail author's email address + @type str + @param committerMail committer's email address + @type str + @return reference to the generated item + @rtype QTreeWidgetItem """ branches = [] allBranches = [] @@ -787,11 +812,17 @@ @param action indicator for the change action ("A", "C", "D", "M", "R", "T", "U", "X") - @param path path of the file in the repository (string) - @param copyfrom path the file was copied from (string) - @param additions number of added lines (int) - @param deletions number of deleted lines (int) - @return reference to the generated item (QTreeWidgetItem) + @type str + @param path path of the file in the repository + @type str + @param copyfrom path the file was copied from + @type str + @param additions number of added lines + @type int + @param deletions number of deleted lines + @type int + @return reference to the generated item + @rtype QTreeWidgetItem """ if len(action) > 1: # includes confidence level @@ -821,8 +852,10 @@ """ Private method to retrieve log entries from the repository. - @param skip number of log entries to skip (integer) - @param noEntries number of entries to get (0 = default) (int) + @param skip number of log entries to skip + @type int + @param noEntries number of entries to get (0 = default) + @type int """ self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(True) @@ -877,10 +910,12 @@ """ Public slot to start the git log command. - @param fn filename to show the log for (string) + @param fn filename to show the log for + @type str @param isFile flag indicating log for a file is to be shown - (boolean) - @param noEntries number of entries to get (0 = default) (int) + @type bool + @param noEntries number of entries to get (0 = default) + @type int """ self.__isFile = isFile @@ -914,8 +949,10 @@ """ Private slot connected to the finished signal. - @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 """ self.__processBuffer() self.__finish() @@ -949,6 +986,7 @@ Private method to process a log entry. @param logEntry dictionary as generated by __processBuffer + @type dict """ self.__generateLogItem( logEntry["author"], @@ -1147,7 +1185,8 @@ """ Private slot to show some error. - @param out error to be shown (string) + @param out error to be shown + @type str """ self.errorGroup.show() self.errors.insertPlainText(out) @@ -1161,7 +1200,8 @@ """ Private slot called by a button of the button box clicked. - @param button button that was clicked (QAbstractButton) + @param button button that was clicked + @type QAbstractButton """ if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): self.close() @@ -1197,7 +1237,8 @@ """ Private slot to handle the password checkbox toggled. - @param isOn flag indicating the status of the check box (boolean) + @param isOn flag indicating the status of the check box + @type bool """ if isOn: self.input.setEchoMode(QLineEdit.EchoMode.Password) @@ -1236,7 +1277,8 @@ """ Protected slot to handle a key press event. - @param evt the key press event (QKeyEvent) + @param evt the key press event + @type QKeyEvent """ if self.intercept: self.intercept = False @@ -1249,7 +1291,8 @@ Private slot to prepare the filed search data. @return tuple of field index, search expression and flag indicating - that the field index is a data role (integer, string, boolean) + that the field index is a data role + @rtype tuple of (int, str, bool) """ indexIsRole = False txt = self.fieldCombo.itemData(self.fieldCombo.currentIndex()) @@ -1593,8 +1636,10 @@ """ Private method to get the commit id for a tag. - @param tag tag name (string) - @return commit id shortened to 10 characters (string) + @param tag tag name + @type str + @return commit id shortened to 10 characters + @rtype str """ args = self.vcs.initCommand("show") args.append("--abbrev-commit") @@ -1631,7 +1676,8 @@ """ Private slot to show the context menu of the log tree. - @param pos position of the mouse pointer (QPoint) + @param pos position of the mouse pointer + @type QPoint """ self.__logTreeMenu.popup(self.logTree.mapToGlobal(pos)) @@ -1640,8 +1686,10 @@ """ Private slot called, when the current item of the log tree changes. - @param current reference to the new current item (QTreeWidgetItem) - @param previous reference to the old current item (QTreeWidgetItem) + @param current reference to the new current item + @type QTreeWidgetItem + @param previous reference to the old current item + @type QTreeWidgetItem """ self.__updateToolMenuActions() @@ -1710,7 +1758,8 @@ """ Private slot called, when the from date changes. - @param date new date (QDate) + @param date new date + @type QDate """ if self.__actionMode() == "filter": self.__filterLogs() @@ -1720,7 +1769,8 @@ """ Private slot called, when the from date changes. - @param date new date (QDate) + @param date new date + @type QDate """ if self.__actionMode() == "filter": self.__filterLogs() @@ -1741,7 +1791,8 @@ """ Private slot called, when a filter expression is entered. - @param txt filter expression (string) + @param txt filter expression + @type str """ if self.__actionMode() == "filter": self.__filterLogs() @@ -1761,7 +1812,8 @@ """ Private slot called, when the stop on copy/move checkbox is clicked. - @param checked flag indicating the state of the check box (boolean) + @param checked flag indicating the state of the check box + @type bool """ self.vcs.getPlugin().setPreferences( "StopLogOnCopy", self.stopCheckBox.isChecked() @@ -2014,7 +2066,8 @@ """ Private slot to show/hide the committer columns. - @param on flag indicating the selection state (boolean) + @param on flag indicating the selection state + @type bool """ self.logTree.setColumnHidden(self.CommitterColumn, not on) self.logTree.setColumnHidden(self.CommitDateColumn, not on) @@ -2026,7 +2079,8 @@ """ Private slot to show/hide the committer columns. - @param on flag indicating the selection state (boolean) + @param on flag indicating the selection state + @type bool """ self.logTree.setColumnHidden(self.AuthorColumn, not on) self.logTree.setColumnHidden(self.DateColumn, not on) @@ -2038,7 +2092,8 @@ """ Private slot to show/hide the commit ID column. - @param on flag indicating the selection state (boolean) + @param on flag indicating the selection state + @type bool """ self.logTree.setColumnHidden(self.CommitIdColumn, not on) self.vcs.getPlugin().setPreferences("ShowCommitIdColumn", on) @@ -2049,7 +2104,8 @@ """ Private slot to show/hide the branches column. - @param on flag indicating the selection state (boolean) + @param on flag indicating the selection state + @type bool """ self.logTree.setColumnHidden(self.BranchColumn, not on) self.vcs.getPlugin().setPreferences("ShowBranchesColumn", on) @@ -2060,7 +2116,8 @@ """ Private slot to show/hide the tags column. - @param on flag indicating the selection state (boolean) + @param on flag indicating the selection state + @type bool """ self.logTree.setColumnHidden(self.TagsColumn, not on) self.vcs.getPlugin().setPreferences("ShowTagsColumn", on) @@ -2074,7 +2131,8 @@ """ Private method to get the selected action mode. - @return selected action mode (string, one of filter or find) + @return selected action mode (one of 'filter' or 'find') + @rtype str """ return self.modeComboBox.itemData(self.modeComboBox.currentIndex()) @@ -2083,7 +2141,8 @@ """ Private slot to react on mode changes. - @param index index of the selected entry (integer) + @param index index of the selected entry + @type int """ mode = self.modeComboBox.itemData(index) findMode = mode == "find" @@ -2119,8 +2178,10 @@ """ Private slot to find an item matching the entered criteria. - @param backwards flag indicating to search backwards (boolean) - @param interactive flag indicating an interactive search (boolean) + @param backwards flag indicating to search backwards + @type bool + @param interactive flag indicating an interactive search + @type bool """ self.__findBackwards = backwards @@ -2292,7 +2353,9 @@ Private method to merge the file separator entries. @param fileSeparators list of file separator entries to be merged + @type list of str @return merged list of file separator entries + @rtype list of str """ separators = {} for oldFile, newFile, pos1, pos2 in sorted(fileSeparators): @@ -2310,8 +2373,10 @@ """ Private slot called, when the current item of the files tree changes. - @param current reference to the new current item (QTreeWidgetItem) - @param previous reference to the old current item (QTreeWidgetItem) + @param current reference to the new current item + @type QTreeWidgetItem + @param previous reference to the old current item + @type QTreeWidgetItem """ if current: para = current.data(0, self.__diffFileLineRole)