Merge commit 'refs/top-bases/t/bug-1568' into t/bug-1568

This commit is contained in:
Sascha Silbe 2010-03-09 22:59:57 +00:00
commit 12016d5408
4 changed files with 25 additions and 32 deletions

View File

@ -5,7 +5,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: sugar-toolkit\n" "Project-Id-Version: sugar-toolkit\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-26 00:33-0400\n" "POT-Creation-Date: 2010-01-20 13:10-0500\n"
"PO-Revision-Date: 2009-09-25 09:03-0400\n" "PO-Revision-Date: 2009-09-25 09:03-0400\n"
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n" "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n" "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@ -16,24 +16,24 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Pootle 1.2.1\n" "X-Generator: Pootle 1.2.1\n"
#: ../src/sugar/activity/activity.py:329 #: ../src/sugar/activity/activity.py:338
#, python-format #, python-format
msgid "%s Activity" msgid "%s Activity"
msgstr "Hoạt động %s" msgstr "Hoạt động %s"
#: ../src/sugar/activity/activity.py:714 #: ../src/sugar/activity/activity.py:738
msgid "Keep error" msgid "Keep error"
msgstr "Giữ lỗi" msgstr "Giữ lỗi"
#: ../src/sugar/activity/activity.py:715 #: ../src/sugar/activity/activity.py:739
msgid "Keep error: all changes will be lost" msgid "Keep error: all changes will be lost"
msgstr "Giữ lỗi: tất cả các thay đổi sẽ bị mất" msgstr "Giữ lỗi: tất cả các thay đổi sẽ bị mất"
#: ../src/sugar/activity/activity.py:718 #: ../src/sugar/activity/activity.py:742
msgid "Don't stop" msgid "Don't stop"
msgstr "Không dừng" msgstr "Không dừng"
#: ../src/sugar/activity/activity.py:721 #: ../src/sugar/activity/activity.py:745
msgid "Stop anyway" msgid "Stop anyway"
msgstr "Vẫn dừng" msgstr "Vẫn dừng"
@ -42,7 +42,7 @@ msgid "Name this entry"
msgstr "Đặt tên mục nhập này" msgstr "Đặt tên mục nhập này"
#: ../src/sugar/activity/namingalert.py:87 #: ../src/sugar/activity/namingalert.py:87
#: ../src/sugar/activity/widgets.py:162 #: ../src/sugar/activity/widgets.py:166
msgid "Keep" msgid "Keep"
msgstr "Giữ" msgstr "Giữ"
@ -58,35 +58,35 @@ msgstr "Mô tả:"
msgid "Tags:" msgid "Tags:"
msgstr "Thẻ:" msgstr "Thẻ:"
#: ../src/sugar/activity/widgets.py:79 #: ../src/sugar/activity/widgets.py:83
msgid "Stop" msgid "Stop"
msgstr "Dừng" msgstr "Dừng"
#: ../src/sugar/activity/widgets.py:91 #: ../src/sugar/activity/widgets.py:95
msgid "Undo" msgid "Undo"
msgstr "Hủy bước" msgstr "Hủy bước"
#: ../src/sugar/activity/widgets.py:99 #: ../src/sugar/activity/widgets.py:103
msgid "Redo" msgid "Redo"
msgstr "Hoàn lại" msgstr "Hoàn lại"
#: ../src/sugar/activity/widgets.py:106 #: ../src/sugar/activity/widgets.py:110
msgid "Copy" msgid "Copy"
msgstr "Chép" msgstr "Chép"
#: ../src/sugar/activity/widgets.py:113 #: ../src/sugar/activity/widgets.py:117
msgid "Paste" msgid "Paste"
msgstr "Dán" msgstr "Dán"
#: ../src/sugar/activity/widgets.py:123 #: ../src/sugar/activity/widgets.py:127
msgid "Private" msgid "Private"
msgstr "Riêng" msgstr "Riêng"
#: ../src/sugar/activity/widgets.py:130 #: ../src/sugar/activity/widgets.py:134
msgid "My Neighborhood" msgid "My Neighborhood"
msgstr "Hàng xóm mình" msgstr "Hàng xóm mình"
#: ../src/sugar/activity/widgets.py:341 #: ../src/sugar/activity/widgets.py:345
msgid "Activity" msgid "Activity"
msgstr "Hoạt động" msgstr "Hoạt động"

View File

@ -393,6 +393,9 @@ class Activity(Window, gtk.Container):
"""Returns the bundle_id from the activity.info file""" """Returns the bundle_id from the activity.info file"""
return os.environ['SUGAR_BUNDLE_ID'] return os.environ['SUGAR_BUNDLE_ID']
def get_canvas(self):
return Window.get_canvas(self)
def set_canvas(self, canvas): def set_canvas(self, canvas):
"""Sets the 'work area' of your activity with the canvas of your """Sets the 'work area' of your activity with the canvas of your
choice. choice.
@ -403,6 +406,8 @@ class Activity(Window, gtk.Container):
if not self._read_file_called: if not self._read_file_called:
canvas.connect('map', self.__canvas_map_cb) canvas.connect('map', self.__canvas_map_cb)
canvas = property(get_canvas, set_canvas)
def __screen_size_changed_cb(self, screen): def __screen_size_changed_cb(self, screen):
self._adapt_window_to_screen() self._adapt_window_to_screen()
@ -517,7 +522,7 @@ class Activity(Window, gtk.Container):
if self._closing: if self._closing:
self._show_keep_failed_dialog() self._show_keep_failed_dialog()
self._closing = False 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): def _cleanup_jobject(self):
if self._jobject: if self._jobject:
@ -769,7 +774,7 @@ class Activity(Window, gtk.Container):
try: try:
self.save() self.save()
except: except:
logging.info(traceback.format_exc()) logging.exception('Error saving activity object to datastore')
self._show_keep_failed_dialog() self._show_keep_failed_dialog()
return False return False
@ -800,7 +805,8 @@ class Activity(Window, gtk.Container):
if not self.can_close(): if not self.can_close():
return 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._closing:
if not self._prepare_close(skip_save): if not self._prepare_close(skip_save):
return return

View File

@ -149,8 +149,7 @@ def open_log_file(activity):
while True: while True:
path = env.get_logs_path('%s-%s.log' % (activity.get_bundle_id(), i)) path = env.get_logs_path('%s-%s.log' % (activity.get_bundle_id(), i))
try: try:
fd = os.open(path, os.O_EXCL | os.O_CREAT \ fd = os.open(path, os.O_EXCL | os.O_CREAT | os.O_WRONLY, 0644)
| os.O_SYNC | os.O_WRONLY, 0644)
f = os.fdopen(fd, 'w', 0) f = os.fdopen(fd, 'w', 0)
return (path, f) return (path, f)
except OSError, e: except OSError, e:

View File

@ -74,18 +74,6 @@ class ContentBundle(Bundle):
section = 'Library' 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'): if cp.has_option(section, 'name'):
self._name = cp.get(section, 'name') self._name = cp.get(section, 'name')
else: else: