]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/distrib/mac/uninstall_wxPython.py
corrected WXDLLIMPEXP_ declaration for wxEventBlocker: it's part of core, not base
[wxWidgets.git] / wxPython / distrib / mac / uninstall_wxPython.py
index 2b4ac110918e1b638c00981dae19b53301e76b98..63abdb3fa7339a13458213dfe7c237832b5173ea 100755 (executable)
@@ -24,8 +24,10 @@ RSRCDIR = "Contents/Resources"
 # /usr, /usr/local, etc.
 PREFIXES = [ '/Library/Python/2.3/',
              '/Library/Python/2.4/',
+             '/Library/Python/2.5/',
              '/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/',
              '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/',
+             '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/',
              '/usr/local/lib/',
              ]
 
@@ -112,6 +114,13 @@ class InstalledReceipt(object):
                 handleFile(name)
             handleDir(dirpath)
 
+    # wxaddons should be always kept as the user may have installed
+    # third-party modules seperate from wxpython.
+    def testWxaddons(self, name):
+        for prefix in PREFIXES:
+            if name.startswith(prefix + "wxaddons"):
+                return True
+        return False
 
     def testCommon(self, name):
         for cmn in COMMON_FILES:
@@ -125,6 +134,8 @@ class InstalledReceipt(object):
             if os.path.exists(name):
                 if not self.lastInstall and self.testCommon(name):
                     return
+                if self.testWxaddons(name):
+                    return
                 print "Will remove:", name
         self.walkFiles(show, show)
 
@@ -144,11 +155,13 @@ class InstalledReceipt(object):
             if os.path.exists(name):
                 if not self.lastInstall and self.testCommon(name):
                     return
+                if self.testWxaddons(name):
+                    return
                 print "Removing:", name
                 os.unlink(name)
         def removeDir(name):
             print "Removing:", name
-            if os.path.exists(name):
+            if os.path.exists(name) and not self.testWxaddons(name):
                 hasFiles = os.listdir(name)
                 if hasFiles:  # perhaps some stale symlinks, or .pyc files
                     for file in hasFiles:
@@ -201,7 +214,7 @@ def main():
         sys.exit()
         
     for i, inst in enumerate(installed):
-        print "  %d.  %s \t%s" % (i+1, inst.mdata["Title"], inst.mdata["Version"])
+        print " %2d.  %-40s    %s" % (i+1, inst.mdata["Title"], inst.mdata["Version"])
         
     print 
     ans = raw_input("Enter the number of the install to examine or 'Q' to quit: ")