#7046: Fix removal of activities
This commit is contained in:
parent
eb839c2ef9
commit
73fe1e9837
@ -23,8 +23,7 @@ import os
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from sugar.bundle.bundle import Bundle, MalformedBundleException, \
|
from sugar.bundle.bundle import Bundle, MalformedBundleException, \
|
||||||
AlreadyInstalledException, RegistrationException, \
|
AlreadyInstalledException, RegistrationException, NotInstalledException
|
||||||
NotInstalledException
|
|
||||||
|
|
||||||
from sugar import activity
|
from sugar import activity
|
||||||
from sugar import env
|
from sugar import env
|
||||||
@ -55,6 +54,7 @@ class ActivityBundle(Bundle):
|
|||||||
self._mime_types = None
|
self._mime_types = None
|
||||||
self._show_launcher = True
|
self._show_launcher = True
|
||||||
self._activity_version = 0
|
self._activity_version = 0
|
||||||
|
self._installation_time = os.stat(path).st_mtime
|
||||||
|
|
||||||
info_file = self.get_file('activity/activity.info')
|
info_file = self.get_file('activity/activity.info')
|
||||||
if info_file is None:
|
if info_file is None:
|
||||||
@ -65,7 +65,7 @@ class ActivityBundle(Bundle):
|
|||||||
if linfo_file:
|
if linfo_file:
|
||||||
self._parse_linfo(linfo_file)
|
self._parse_linfo(linfo_file)
|
||||||
|
|
||||||
self.manifest = None #This should be replaced by following function
|
self.manifest = None # This should be replaced by following function
|
||||||
self.read_manifest()
|
self.read_manifest()
|
||||||
|
|
||||||
def _raw_manifest(self):
|
def _raw_manifest(self):
|
||||||
@ -226,7 +226,7 @@ class ActivityBundle(Bundle):
|
|||||||
def get_installation_time(self):
|
def get_installation_time(self):
|
||||||
"""Get a timestamp representing the time at which this activity was
|
"""Get a timestamp representing the time at which this activity was
|
||||||
installed."""
|
installed."""
|
||||||
return os.stat(self._path).st_mtime
|
return self._installation_time
|
||||||
|
|
||||||
def get_bundle_id(self):
|
def get_bundle_id(self):
|
||||||
"""Get the activity bundle id"""
|
"""Get the activity bundle id"""
|
||||||
|
Loading…
Reference in New Issue
Block a user