Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/bundle/bundle.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-10-04 20:46:32 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-10-04 20:46:32 (GMT)
commit32ecdd8ad628edd6affa6a0d4496a121b5a67a53 (patch)
treecfd8621c09d5e4db6f6d29a70028c921ae13ac4c /sugar/bundle/bundle.py
parent5ca3b9081a32cc9e947700107ee26ccce06ede88 (diff)
parent2bcbde6e441ee5ab5743f6b45b5f85e85bbb644f (diff)
Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
Diffstat (limited to 'sugar/bundle/bundle.py')
-rw-r--r--sugar/bundle/bundle.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/sugar/bundle/bundle.py b/sugar/bundle/bundle.py
index 2657846..8ce3dda 100644
--- a/sugar/bundle/bundle.py
+++ b/sugar/bundle/bundle.py
@@ -130,19 +130,17 @@ class Bundle:
zip.write(filename, os.path.join(base_dir, filename))
zip.close()
- def _uninstall(self):
- ext = os.path.splitext(self._path)[1]
- if self._unpacked:
- if not os.path.isdir(self._path) or ext != self._unzipped_extension:
- raise InvalidPathException
- for root, dirs, files in os.walk(self._path, topdown=False):
- for name in files:
- os.remove(os.path.join(root, name))
- for name in dirs:
- os.rmdir(os.path.join(root, name))
- os.rmdir(self._path)
- else:
- if not os.path.isfile(self._path) or ext != self._zipped_extension:
+ def _uninstall(self, install_path):
+ if not os.path.isdir(install_path):
+ raise InvalidPathException
+ if self._unzipped_extension is not None:
+ ext = os.path.splitext(install_path)[1]
+ if ext != self._unzipped_extension:
raise InvalidPathException
- os.remove(self._path)
-
+
+ for root, dirs, files in os.walk(install_path, topdown=False):
+ for name in files:
+ os.remove(os.path.join(root, name))
+ for name in dirs:
+ os.rmdir(os.path.join(root, name))
+ os.rmdir(install_path)