diff options
Diffstat (limited to 'src/sugar/bundle/activitybundle.py')
-rw-r--r-- | src/sugar/bundle/activitybundle.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py index 2a5192d..b2548a4 100644 --- a/src/sugar/bundle/activitybundle.py +++ b/src/sugar/bundle/activitybundle.py @@ -25,6 +25,7 @@ import locale import os import tempfile import logging +import shutil from sugar import env from sugar import util @@ -291,7 +292,7 @@ class ActivityBundle(Bundle): os.unlink(dst) os.symlink(src, dst) - def uninstall(self, install_path, force=False): + def uninstall(self, install_path, force=False, delete_profile=False): if os.path.islink(install_path): # Don't remove the actual activity dir if it's a symbolic link # because we may be removing user data. @@ -320,6 +321,12 @@ class ActivityBundle(Bundle): os.readlink(path).startswith(install_path): os.remove(path) + if delete_profile: + bundle_profile_path = env.get_profile_path(self._bundle_id) + if os.path.exists(bundle_profile_path): + os.chmod(bundle_profile_path, 0775) + shutil.rmtree(bundle_profile_path, ignore_errors=True) + self._uninstall(install_path) def is_user_activity(self): |