Updated the install and uninstall script to cope with the __pycache__ directories.

Sat, 02 Jul 2011 15:47:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 02 Jul 2011 15:47:49 +0200
changeset 1161
ddab52aa1a6b
parent 1158
33dce2093b6f
child 1162
ab292b7f4f8a

Updated the install and uninstall script to cope with the __pycache__ directories.

install.py file | annotate | diff | comparison | revisions
uninstall.py file | annotate | diff | comparison | revisions
--- a/install.py	Sat Jul 02 14:59:45 2011 +0200
+++ b/install.py	Sat Jul 02 15:47:49 2011 +0200
@@ -315,11 +315,15 @@
         e5cfile = os.path.join(pyModDir, name)
         if os.path.exists(e5cfile):
             os.remove(e5cfile)
+        e5cfile = os.path.join(pyModDir, "__pycache__", name)
+        path, ext = os.path.splitext(e5cfile)
+        for f in glob.glob("{0}.*{1}".format(path, ext)):
+            os.remove(f)
         
     # Cleanup the install directories
     for name in ['ericExamplesDir', 'ericDocDir', 'ericDTDDir', 'ericCSSDir',
-                 'ericIconDir', 'ericPixDir', 'ericDir', 'ericTemplatesDir',
-                 'ericCodeTemplatesDir', 'ericOthersDir', 'ericStylesDir']:
+                 'ericIconDir', 'ericPixDir', 'ericTemplatesDir', 'ericCodeTemplatesDir',
+                 'ericOthersDir', 'ericStylesDir', 'ericDir']:
         if os.path.exists(getConfig(name)):
             shutil.rmtree(getConfig(name), True)
     
--- a/uninstall.py	Sat Jul 02 14:59:45 2011 +0200
+++ b/uninstall.py	Sat Jul 02 15:47:49 2011 +0200
@@ -103,11 +103,15 @@
         e5cfile = os.path.join(pyModDir, name)
         if os.path.exists(e5cfile):
             os.remove(e5cfile)
+        e5cfile = os.path.join(pyModDir, "__pycache__", name)
+        path, ext = os.path.splitext(e5cfile)
+        for f in glob.glob("{0}.*{1}".format(path, ext)):
+            os.remove(f)
     
     # Cleanup the install directories
     for name in ['ericExamplesDir', 'ericDocDir', 'ericDTDDir', 'ericCSSDir',
-                 'ericIconDir', 'ericPixDir', 'ericDir', 'ericTemplatesDir',
-                 'ericCodeTemplatesDir', 'ericOthersDir', 'ericStylesDir']:
+                 'ericIconDir', 'ericPixDir', 'ericTemplatesDir', 'ericCodeTemplatesDir',
+                 'ericOthersDir', 'ericStylesDir', 'ericDir']:
         dirpath = getConfig(name)
         if os.path.exists(dirpath):
             shutil.rmtree(dirpath, True)

eric ide

mercurial