From b3ad232b0c04ea7e87df2fb8c6c538f84189daba Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sat, 8 Sep 2007 16:11:47 +0200 Subject: [PATCH] #2909: Make python activities more tolerant to missing metadata properties. --- NEWS | 1 + sugar/activity/activity.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 4fcd2f6f..e8ba4472 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* #2909: Make python activities more tolerant to missing metadata properties. (tomeu) * #2653: Add audio/wav and audio/x-wav as Audio objects. (tomeu) * Support moving of data files written to the datastore using standard Activity write_file() API (dcbw) diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index a5661cd8..f734c61b 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -284,6 +284,9 @@ class Activity(Window, gtk.Container): #del self._jobject.metadata['ctime'] del self._jobject.metadata['mtime'] + if not self._jobject.metadata.has_key('title'): + self._jobject.metadata['title'] = '' + try: share_scope = self._jobject.metadata['share-scope'] title = self._jobject.metadata['title']