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 ""
"Project-Id-Version: sugar-toolkit\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"
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@ -16,24 +16,24 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Pootle 1.2.1\n"
#: ../src/sugar/activity/activity.py:329
#: ../src/sugar/activity/activity.py:338
#, python-format
msgid "%s Activity"
msgstr "Hoạt động %s"
#: ../src/sugar/activity/activity.py:714
#: ../src/sugar/activity/activity.py:738
msgid "Keep error"
msgstr "Giữ lỗi"
#: ../src/sugar/activity/activity.py:715
#: ../src/sugar/activity/activity.py:739
msgid "Keep error: all changes will be lost"
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"
msgstr "Không dừng"
#: ../src/sugar/activity/activity.py:721
#: ../src/sugar/activity/activity.py:745
msgid "Stop anyway"
msgstr "Vẫn dừng"
@ -42,7 +42,7 @@ msgid "Name this entry"
msgstr "Đặt tên mục nhập này"
#: ../src/sugar/activity/namingalert.py:87
#: ../src/sugar/activity/widgets.py:162
#: ../src/sugar/activity/widgets.py:166
msgid "Keep"
msgstr "Giữ"
@ -58,35 +58,35 @@ msgstr "Mô tả:"
msgid "Tags:"
msgstr "Thẻ:"
#: ../src/sugar/activity/widgets.py:79
#: ../src/sugar/activity/widgets.py:83
msgid "Stop"
msgstr "Dừng"
#: ../src/sugar/activity/widgets.py:91
#: ../src/sugar/activity/widgets.py:95
msgid "Undo"
msgstr "Hủy bước"
#: ../src/sugar/activity/widgets.py:99
#: ../src/sugar/activity/widgets.py:103
msgid "Redo"
msgstr "Hoàn lại"
#: ../src/sugar/activity/widgets.py:106
#: ../src/sugar/activity/widgets.py:110
msgid "Copy"
msgstr "Chép"
#: ../src/sugar/activity/widgets.py:113
#: ../src/sugar/activity/widgets.py:117
msgid "Paste"
msgstr "Dán"
#: ../src/sugar/activity/widgets.py:123
#: ../src/sugar/activity/widgets.py:127
msgid "Private"
msgstr "Riêng"
#: ../src/sugar/activity/widgets.py:130
#: ../src/sugar/activity/widgets.py:134
msgid "My Neighborhood"
msgstr "Hàng xóm mình"
#: ../src/sugar/activity/widgets.py:341
#: ../src/sugar/activity/widgets.py:345
msgid "Activity"
msgstr "Hoạt động"

View File

@ -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

View File

@ -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:

View File

@ -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: