Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2010-03-09 22:59:57 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-03-09 22:59:57 (GMT)
commit12016d54088c8bbd0b48b33e591ffab94875360b (patch)
treebc369b6dee2173a9951deb7bb45284aa20601a97 /src
parentb64930b2ebc86407e8d53e155dd6939ebfb4fd67 (diff)
parentd006092d37b180bb0490ab7e1182662afc5ae5cf (diff)
Merge commit 'refs/top-bases/t/bug-1568' into t/bug-1568
Diffstat (limited to 'src')
-rw-r--r--src/sugar/activity/activity.py12
-rw-r--r--src/sugar/activity/activityfactory.py3
-rw-r--r--src/sugar/bundle/contentbundle.py12
3 files changed, 10 insertions, 17 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
index d4892d0..c91a023 100644
--- a/src/sugar/activity/activity.py
+++ b/src/sugar/activity/activity.py
@@ -393,6 +393,9 @@ class Activity(Window, gtk.Container):
"""Returns the bundle_id from the activity.info file"""
return os.environ['SUGAR_BUNDLE_ID']
+ def get_canvas(self):
+ return Window.get_canvas(self)
+
def set_canvas(self, canvas):
"""Sets the 'work area' of your activity with the canvas of your
choice.
@@ -403,6 +406,8 @@ class Activity(Window, gtk.Container):
if not self._read_file_called:
canvas.connect('map', self.__canvas_map_cb)
+ canvas = property(get_canvas, set_canvas)
+
def __screen_size_changed_cb(self, screen):
self._adapt_window_to_screen()
@@ -517,7 +522,7 @@ class Activity(Window, gtk.Container):
if self._closing:
self._show_keep_failed_dialog()
self._closing = False
- logging.debug('Error saving activity object to datastore: %s', err)
+ raise RuntimeError('Error saving activity object to datastore: %s', err)
def _cleanup_jobject(self):
if self._jobject:
@@ -769,7 +774,7 @@ class Activity(Window, gtk.Container):
try:
self.save()
except:
- logging.info(traceback.format_exc())
+ logging.exception('Error saving activity object to datastore')
self._show_keep_failed_dialog()
return False
@@ -800,7 +805,8 @@ class Activity(Window, gtk.Container):
if not self.can_close():
return
- if skip_save or self.metadata.get('title_set_by_user', '0') == '1':
+ if skip_save or self._jobject is None or \
+ self.metadata.get('title_set_by_user', '0') == '1':
if not self._closing:
if not self._prepare_close(skip_save):
return
diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py
index eda7d9a..c12630e 100644
--- a/src/sugar/activity/activityfactory.py
+++ b/src/sugar/activity/activityfactory.py
@@ -149,8 +149,7 @@ def open_log_file(activity):
while True:
path = env.get_logs_path('%s-%s.log' % (activity.get_bundle_id(), i))
try:
- fd = os.open(path, os.O_EXCL | os.O_CREAT \
- | os.O_SYNC | os.O_WRONLY, 0644)
+ fd = os.open(path, os.O_EXCL | os.O_CREAT | os.O_WRONLY, 0644)
f = os.fdopen(fd, 'w', 0)
return (path, f)
except OSError, e:
diff --git a/src/sugar/bundle/contentbundle.py b/src/sugar/bundle/contentbundle.py
index 4b483cb..48e05a1 100644
--- a/src/sugar/bundle/contentbundle.py
+++ b/src/sugar/bundle/contentbundle.py
@@ -74,18 +74,6 @@ class ContentBundle(Bundle):
section = 'Library'
- if cp.has_option(section, 'host_version'):
- version = cp.get(section, 'host_version')
- try:
- if int(version) != 1:
- raise MalformedBundleException(
- 'Content bundle %s has unknown host_version '
- 'number %s' % (self._path, version))
- except ValueError:
- raise MalformedBundleException(
- 'Content bundle %s has invalid host_version number %s' %
- (self._path, version))
-
if cp.has_option(section, 'name'):
self._name = cp.get(section, 'name')
else: