]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/distrib/mac/uninstall_wxPython.py
Do not uninstall wxaddons module or files.
[wxWidgets.git] / wxPython / distrib / mac / uninstall_wxPython.py
index c99d3015350041490f0ddf732805a7748a54cec0..caa0aea4c9e6d3537a6654858356fdb9653f19a2 100755 (executable)
@@ -112,6 +112,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 +132,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 +153,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: