scripts/install-debugclients.py

branch
eric7-maintenance
changeset 10460
3b34efa2857c
parent 10439
21c28b0f9e41
child 10781
0e3d6e22efaf
diff -r 411df92e881f -r 3b34efa2857c scripts/install-debugclients.py
--- a/scripts/install-debugclients.py	Sun Dec 03 14:54:00 2023 +0100
+++ b/scripts/install-debugclients.py	Mon Jan 01 11:10:45 2024 +0100
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
-# Copyright (c) 2016 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
+# Copyright (c) 2016 - 2024 Detlev Offenbach <detlev@die-offenbachs.de>
 #
 # This is the install script for the eric debug client. It may be used
 # to just install the debug clients for remote debugging.
@@ -41,7 +41,8 @@
     """
     Exit the install script.
 
-    @param rcode result code to report back (integer)
+    @param rcode result code to report back
+    @type int
     """
     global currDir
 
@@ -79,11 +80,16 @@
     Copy files 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 str
     """
     if excludeDirs is None:
         excludeDirs = []
@@ -121,7 +127,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 the __pycache__ directory and all *.pyc files
     if os.path.exists(os.path.join(dirName, "__pycache__")):
@@ -148,7 +155,7 @@
         # Cleanup the install directories
         dirname = os.path.join(pyModDir, installPackage)
         if os.path.exists(dirname):
-            shutil.rmtree(dirname, True)
+            shutil.rmtree(dirname, ignore_errors=True)
     except OSError as msg:
         sys.stderr.write("Error: {0}\nTry install with admin rights.\n".format(msg))
         exit(7)
@@ -158,9 +165,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):
@@ -172,7 +182,8 @@
     """
     Actually perform the installation steps.
 
-    @return result code (integer)
+    @return result code
+    @rtype int
     """
     global distDir, doCleanup, sourceDir, modDir
 
@@ -403,7 +414,8 @@
     """
     The main function of the script.
 
-    @param argv the list of command line arguments.
+    @param argv the list of command line arguments
+    @type list of str
     """
     global modDir, doCleanup, doCompile, distDir
     global sourceDir, eric7SourceDir
@@ -450,7 +462,7 @@
         if doCleanup:
             print("Cleaning up old installation ...", end="", flush=True)
             if distDir:
-                shutil.rmtree(distDir, True)
+                shutil.rmtree(distDir, ignore_errors=True)
             else:
                 cleanUp()
             print(" Done")

eric ide

mercurial