diff -r 2fda68a9168d -r 5ac83a87954d scripts/install.py --- a/scripts/install.py Mon Dec 18 16:39:44 2023 +0100 +++ b/scripts/install.py Mon Dec 18 17:45:20 2023 +0100 @@ -102,7 +102,8 @@ """ Exit the install script. - @param rcode result code to report back (integer) + @param rcode result code to report back + @type int """ global currDir @@ -173,8 +174,10 @@ """ Copy a string to a file. - @param name the name of the file. - @param text the contents to copy to the file. + @param name name of the file + @type str + @param text contents to copy to the file + @type str """ with open(name, "w") as f: f.write(text) @@ -184,8 +187,10 @@ """ Modify a desktop file and write it to its destination. - @param src source file name (string) - @param dst destination file name (string) + @param src source file name + @type str + @param dst destination file name + @type str """ global cfg, platBinDir @@ -208,8 +213,10 @@ """ Modify an appstream file and write it to its destination. - @param src source file name (string) - @param dst destination file name (string) + @param src source file name + @type str + @param dst destination file name + @type str """ if os.path.exists(os.path.join("eric", "src", "eric7", "UI", "Info.py")): # Installing from installer archive @@ -242,13 +249,16 @@ Create the platform specific names for the wrapper script. @param dname name of the directory to place the wrapper into + @type str @param wfile basename (without extension) of the wrapper script - @return the names of the wrapper scripts + @type str + @return list containing the names of the wrapper scripts + @rtype list of str """ wnames = ( - (dname + "\\" + wfile + ".cmd", dname + "\\" + wfile + ".bat") + [dname + "\\" + wfile + ".cmd", dname + "\\" + wfile + ".bat"] if sys.platform.startswith(("win", "cygwin")) - else (dname + "/" + wfile,) + else [dname + "/" + wfile] ) return wnames @@ -258,13 +268,17 @@ """ Create an executable wrapper for a Python script. - @param pydir the name of the directory where the Python script will - eventually be installed (string) - @param wfile the basename of the wrapper (string) - @param saveDir directory to save the file into (string) - @param isGuiScript flag indicating a wrapper script for a GUI - application (boolean) - @return the platform specific name of the wrapper (string) + @param pydir name of the directory where the Python script will + eventually be installed + @type str + @param wfile basename of the wrapper + @type str + @param saveDir directory to save the file into + @type str + @param isGuiScript flag indicating a wrapper script for a GUI application + @type bool + @return the platform specific name of the wrapper + @rtype str """ # all kinds of Windows systems if sys.platform.startswith(("win", "cygwin")): @@ -319,11 +333,16 @@ designer template files and DTDs of a directory tree. @param src name of the source directory + @type str @param dst name of the destination directory + @type str @param filters list of filter pattern determining the files to be copied + @type list of str @param excludeDirs list of (sub)directories to exclude from copying + @type list of str @param excludePatterns list of filter pattern determining the files to be skipped + @type list of str """ if excludeDirs is None: excludeDirs = [] @@ -384,7 +403,8 @@ Cleanup the sources directory to get rid of leftover files and directories. - @param dirName name of the directory to prune (string) + @param dirName name of the directory to prune + @type str """ # step 1: delete all Ui_*.py files without a corresponding # *.ui file @@ -659,9 +679,12 @@ """ Wrapper function around shutil.copy() to ensure the permissions. - @param src source file name (string) - @param dst destination file name or directory name (string) - @param perm permissions to be set (integer) + @param src source file name + @type str + @param dst destination file name or directory name + @type str + @param perm permissions to be set + @type int """ shutil.copy(src, dst) if os.path.isdir(dst): @@ -673,7 +696,8 @@ """ Actually perform the installation steps. - @return result code (integer) + @return result code + @rtype int """ global distDir, doCleanup, cfg, progLanguages, sourceDir, configName global installApis @@ -1841,9 +1865,12 @@ Local function to create the Python source file name for the compiled .ui file. - @param py_dir suggested name of the directory (string) - @param py_file suggested name for the compile source file (string) - @return tuple of directory name (string) and source file name (string) + @param py_dir suggested name of the directory + @type str + @param py_file suggested name for the compile source file + @type str + @return tuple of directory name and source file name + @rtype tuple of (str, str) """ return py_dir, "Ui_{0}".format(py_file) @@ -1928,7 +1955,8 @@ """ Function to prepare an Info.py file when installing from source. - @param fileName name of the Python file containing the info (string) + @param fileName name of the Python file containing the info + @type str """ if not fileName: return