--- a/src/eric7/VCS/VersionControl.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/VCS/VersionControl.py Fri Dec 22 17:24:07 2023 +0100 @@ -66,8 +66,10 @@ """ Constructor - @param parent parent widget (QWidget) - @param name name of this object (string) + @param parent parent widget + @type QWidget + @param name name of this object + @type str """ super().__init__(parent) if name: @@ -107,8 +109,9 @@ """ Public method used to test for the presence of the vcs. - @return tuple of flag indicating the existence and a string - giving an error message in case of failure + @return tuple of flag indicating the existence and an error message + in case of failure + @rtype tuple of (bool, str) @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -120,9 +123,12 @@ """ Public method used to initialize the vcs. - @param vcsDir name of the VCS directory (string) - @param noDialog flag indicating quiet operations (boolean) - @return flag indicating success (boolean) + @param vcsDir name of the VCS directory + @type str + @param noDialog flag indicating quiet operations + @type bool + @return flag indicating success + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -152,7 +158,7 @@ @param vcsDataDict dictionary of data required for the import @type dict - @param projectDir project directory (string) + @param projectDir project directory @type str @param noDialog flag indicating quiet operations @type bool @@ -173,9 +179,13 @@ Public method used to check the project out of the vcs. @param vcsDataDict dictionary of data required for the checkout - @param projectDir project directory to create (string) + @type dict + @param projectDir project directory to create + @type str @param noDialog flag indicating quiet operations - @return flag indicating an execution without errors (boolean) + @type bool + @return flag indicating an execution without errors + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -188,8 +198,11 @@ Public method used to export a directory from the vcs. @param vcsDataDict dictionary of data required for the export - @param projectDir project directory to create (string) - @return flag indicating an execution without errors (boolean) + @type dict + @param projectDir project directory to create + @type str + @return flag indicating an execution without errors + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -202,10 +215,14 @@ Public method used to make the change of a file/directory permanent in the vcs. - @param name file/directory name to be committed (string) - @param message message for this operation (string) - @param noDialog flag indicating quiet operations (boolean) - @return flag indicating success (boolean) + @param name file/directory name to be committed + @type str + @param message message for this operation + @type str + @param noDialog flag indicating quiet operations + @type bool + @return flag indicating success + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -329,10 +346,13 @@ """ Public method used to update a file/directory in the vcs. - @param name file/directory name to be updated (string) - @param noDialog flag indicating quiet operations (boolean) + @param name file/directory name to be updated + @type str + @param noDialog flag indicating quiet operations + @type bool @return flag indicating, that the update contained an add - or delete (boolean) + or delete + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -344,9 +364,12 @@ """ Public method used to add a file/directory in the vcs. - @param name file/directory name to be added (string) - @param isDir flag indicating name is a directory (boolean) - @param noDialog flag indicating quiet operations (boolean) + @param name file/directory name to be added + @type str + @param isDir flag indicating name is a directory + @type bool + @param noDialog flag indicating quiet operations + @type bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -356,8 +379,10 @@ """ Public method used to add a file/directory in binary mode in the vcs. - @param name file/directory name to be added (string) - @param isDir flag indicating name is a directory (boolean) + @param name file/directory name to be added + @type str + @param isDir flag indicating name is a directory + @type bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -367,7 +392,8 @@ """ Public method to add a directory tree rooted at path in the vcs. - @param path root directory of the tree to be added (string) + @param path root directory of the tree to be added + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -377,10 +403,14 @@ """ Public method used to add a file/directory in the vcs. - @param name file/directory name to be removed (string) - @param project flag indicating deletion of a project tree (boolean) + @param name file/directory name to be removed + @type str + @param project flag indicating deletion of a project tree + @type bool @param noDialog flag indicating quiet operations - @return flag indicating success (boolean) + @type bool + @return flag indicating success + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -392,11 +422,16 @@ """ Public method used to move a file/directory. - @param name file/directory name to be moved (string) + @param name file/directory name to be moved + @type str @param project reference to the project object - @param target new name of the file/directory (string) + @type Project + @param target new name of the file/directory + @type str @param noDialog flag indicating quiet operations - @return flag indicating successfull operation (boolean) + @type bool + @return flag indicating successfull operation + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -409,9 +444,10 @@ Public method used to view the log of a file/directory in the vcs with a log browser dialog. - @param name file/directory name to show the log for (string) + @param name file/directory name to show the log for + @type str @param isFile flag indicating log for a file is to be shown - (boolean) + @type bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -421,7 +457,8 @@ """ Public method used to view the diff of a file/directory in the vcs. - @param name file/directory name to be diffed (string) + @param name file/directory name to be diffed + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -447,7 +484,8 @@ """ Public method used to view the status of a file/directory in the vcs. - @param name file/directory name to show the status for (string) + @param name file/directory name to show the status for + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -457,7 +495,8 @@ """ Public method used to set the tag of a file/directory in the vcs. - @param name file/directory name to be tagged (string) + @param name file/directory name to be tagged + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -494,9 +533,11 @@ """ Public method used to switch a directory to a different tag/branch. - @param name directory name to be switched (string) + @param name directory name to be switched + @type str @return flag indicating, that the switch contained an add - or delete (boolean) + or delete + @rtype bool @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -508,7 +549,8 @@ """ Public method used to merge a tag/branch into the local project. - @param name file/directory name to be merged (string) + @param name file/directory name to be merged + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -518,9 +560,11 @@ """ Public method used to get the registered state of a file in the vcs. - @param name filename to check (string) + @param name filename to check + @type str @return a combination of canBeCommited and canBeAdded or 0 in order to signal an error + @rtype int @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -534,9 +578,12 @@ in the vcs. @param names dictionary with all filenames to be checked as keys - @param dname directory to check in (string) + @type dict + @param dname directory to check in + @type str @return the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error + @rtype dict @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -548,7 +595,8 @@ """ Public method returning the name of the vcs. - @return name of the vcs (string) + @return name of the vcs + @rtype str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -560,7 +608,8 @@ """ Public method used to cleanup the local copy. - @param name directory name to be cleaned up (string) + @param name directory name to be cleaned up + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -570,7 +619,8 @@ """ Public method used to execute arbitrary vcs commands. - @param name directory name of the working directory (string) + @param name directory name of the working directory + @type str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -581,10 +631,13 @@ Public method to get a dialog to enter repository info. @param project reference to the project object - @param archive name of the project in the repository (string) + @type Project + @param archive name of the project in the repository + @type str @param editable flag indicating that the project name is editable - (boolean) - @param parent parent widget (QWidget) + @type bool + @param parent parent widget + @type QWidget @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -595,7 +648,8 @@ Public method to get a dialog to enter repository info for getting a new project. - @param parent parent widget (QWidget) + @param parent parent widget + @type QWidget @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -605,8 +659,10 @@ """ Public method to retrieve information about the repository. - @param ppath local path to get the repository infos (string) - @return string with ready formated info for display (string) + @param ppath local path to get the repository infos + @type str + @return string with ready formated info for display + @rtype str @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -620,10 +676,14 @@ project browsers. @param browser reference to the project browser object + @type ProjectBaseBrowser @param project reference to the project object + @type Project @param isTranslationsBrowser flag indicating, the helper is requested for the translations browser (this needs some special treatment) + @type bool @return the project browser helper object + @rtype VcsProjectBrowserHelper @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -636,7 +696,9 @@ Public method to instanciate a helper object for the project. @param project reference to the project object + @type Project @return the project helper object + @rtype VcsProjectHelper @exception NotImplementedError to indicate that this method must be implemented by a subclass """ @@ -661,7 +723,8 @@ This method could ensure, that certain files or directories are exclude from being version controlled. - @param project reference to the project (Project) + @param project reference to the project + @type Project """ pass @@ -670,7 +733,7 @@ Public method to signal the support of user settable command options. @return flag indicating the support of user settable command options - (boolean) + @rtype bool """ return True @@ -679,7 +742,8 @@ Public method used to set the options for the vcs. @param options a dictionary of option strings with keys as - defined by the default options + defined by the default options + @type dict """ if self.vcsSupportCommandOptions(): for key in options: @@ -692,6 +756,7 @@ @return a dictionary of option strings that can be passed to vcsSetOptions. + @rtype dict """ if self.vcsSupportCommandOptions(): return self.options @@ -703,6 +768,7 @@ Public method used to set vcs specific data. @param data a dictionary of vcs specific data + @type dict """ for key in data: with contextlib.suppress(KeyError): @@ -713,6 +779,7 @@ Public method used to retrieve vcs specific data. @return a dictionary of vcs specific data + @rtype dict """ return self.otherData @@ -720,8 +787,10 @@ """ Public method used to set an entry in the otherData dictionary. - @param key the key of the data (string) + @param key the key of the data + @type str @param value the value of the data + @type Any """ if key in self.interestingDataKeys: self.otherData[key] = value @@ -731,6 +800,7 @@ Public method used to set entries in the otherData dictionary. @param dictionary dictionary to pick entries from + @type dict """ for key in self.interestingDataKeys: if key in dictionary: @@ -757,11 +827,16 @@ This method starts a process and waits for its end while still serving the Qt event loop. - @param proc process to start (QProcess) - @param program path of the executable to start (string) - @param arguments list of arguments for the process (list of strings) - @param workingDir working directory for the process (string) - @return flag indicating normal exit (boolean) + @param proc process to start + @type QProcess + @param program path of the executable to start + @type str + @param arguments list of arguments for the process + @type list of str + @param workingDir working directory for the process + @type str + @return flag indicating normal exit + @rtype bool """ if proc is None: return False @@ -795,8 +870,10 @@ """ Public method splitting name into a directory part and a file part. - @param name path name (string) - @return a tuple of 2 strings (dirname, filename). + @param name path name + @type str + @return tuple containing the directory name and the file name + @rtype tuple of (str, str) """ if os.path.isdir(name): dn = os.path.abspath(name) @@ -810,8 +887,10 @@ Public method splitting the list of names into a common directory part and a file list. - @param names list of paths (list of strings) - @return a tuple of string and list of strings (dirname, filenamelist) + @param names list of paths + @type list of str + @return tuple containing the directory name and the file name list + @rtype tuple of (str, list of str) """ dname = os.path.commonprefix(names) if dname: @@ -828,8 +907,10 @@ Public method to add an argument list to the already present arguments. - @param args current arguments list (list of strings) - @param argslist list of arguments (list of strings) + @param args current arguments list + @type list of str + @param argslist list of arguments + @type list of str """ for arg in argslist: if arg != "": @@ -894,7 +975,9 @@ Public method to start the VCS status monitor thread. @param project reference to the project object - @return reference to the monitor thread (QThread) + @type Project + @return reference to the monitor thread + @rtype QThread """ vcsStatusMonitorInterval = ( project.pudata["VCSSTATUSMONITORINTERVAL"] @@ -960,8 +1043,10 @@ """ Public method to change the monitor interval. - @param interval new interval in seconds (integer) + @param interval new interval in seconds + @type int @param project reference to the project object + @type Project """ if self.statusMonitorThread is not None: if interval == 0: @@ -975,7 +1060,8 @@ """ Public method to get the monitor interval. - @return interval in seconds (integer) + @return interval in seconds + @rtype int """ if self.statusMonitorThread is not None: return self.statusMonitorThread.getInterval() @@ -986,7 +1072,8 @@ """ Public method to enable the auto update function. - @param auto status of the auto update function (boolean) + @param auto status of the auto update function + @type bool """ if self.statusMonitorThread is not None: self.statusMonitorThread.setAutoUpdate(auto) @@ -995,7 +1082,8 @@ """ Public method to retrieve the status of the auto update function. - @return status of the auto update function (boolean) + @return status of the auto update function + @rtype bool """ if self.statusMonitorThread is not None: return self.statusMonitorThread.getAutoUpdate() @@ -1015,7 +1103,8 @@ """ Public method to clear the cached VCS state of a file/directory. - @param name name of the entry to be cleared (string) + @param name name of the entry to be cleared + @type str """ if self.statusMonitorThread is not None: self.statusMonitorThread.clearCachedState(name) @@ -1029,8 +1118,10 @@ support VCS status monitoring. @param interval check interval for the monitor thread in seconds - (integer) + @type int @param project reference to the project object - @return reference to the monitor thread (QThread) + @type Project + @return reference to the monitor thread + @rtype QThread """ return None # __IGNORE_WARNING_M831__