X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/156fa22b80b900c693432960f0003db8235850e3..9e477492e29e03c02827b1e42a16cb09a13f5149:/wxPython/distrib/mac/uninstall_wxPython.py?ds=sidebyside diff --git a/wxPython/distrib/mac/uninstall_wxPython.py b/wxPython/distrib/mac/uninstall_wxPython.py index 4d85ac3e7a..63abdb3fa7 100755 --- a/wxPython/distrib/mac/uninstall_wxPython.py +++ b/wxPython/distrib/mac/uninstall_wxPython.py @@ -24,8 +24,10 @@ RSRCDIR = "Contents/Resources" # /usr, /usr/local, etc. PREFIXES = [ '/Library/Python/2.3/', '/Library/Python/2.4/', - '/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-pacakges/', - '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pacakges/', + '/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: ")