From 369df637c8f923600729bb06628a70cc3c4a39f9 Mon Sep 17 00:00:00 2001
From: Martin Abente <mabente@paraguayeduca.org>
Date: Mon, 5 Jul 2010 15:26:51 -0400
Subject: [PATCH] Delete activities profile data when uninstall
Organization: Paraguay Educa
When activities are uninstalled, profile data persists. Profile
data can consume a lot of disk space. Therefore it is necessary
to delete it.
More info http://bugs.sugarlabs.org/ticket/2074
---
src/sugar/bundle/activitybundle.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py
index c83257f..51ad312 100644
a
|
b
|
import locale |
25 | 25 | import os |
26 | 26 | import tempfile |
27 | 27 | import logging |
| 28 | import shutil |
28 | 29 | |
29 | 30 | from sugar import env |
30 | 31 | from sugar import util |
… |
… |
class ActivityBundle(Bundle): |
417 | 418 | os.readlink(path).startswith(install_path): |
418 | 419 | os.remove(path) |
419 | 420 | |
| 421 | profile_path = env.get_profile_path(self._bundle_id) |
| 422 | if os.path.exists(profile_path): |
| 423 | shutil.rmtree(profile_path) |
| 424 | |
420 | 425 | self._uninstall(install_path) |
421 | 426 | |
422 | 427 | def is_user_activity(self): |