Merge branch 'master' of git://dev.laptop.org/sugar-toolkit

This commit is contained in:
Simon Schampijer 2008-07-21 19:20:31 +02:00
commit 2905360178
3 changed files with 61 additions and 34 deletions

View File

@ -2,23 +2,22 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-06-24 00:07+0530\n" "POT-Creation-Date: 2008-06-24 00:07+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2008-07-21 08:22-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: korakurider <korakurider@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 1.1.1rc4\n" "X-Generator: Pootle 1.1.0rc2\n"
#: ../src/sugar/activity/activity.py:120 #: ../src/sugar/activity/activity.py:120
msgid "Share with:" msgid "Share with:"
msgstr "" msgstr "次の人と共有:"
#: ../src/sugar/activity/activity.py:122 #: ../src/sugar/activity/activity.py:122
msgid "Private" msgid "Private"
@ -26,40 +25,40 @@ msgstr ""
#: ../src/sugar/activity/activity.py:123 #: ../src/sugar/activity/activity.py:123
msgid "My Neighborhood" msgid "My Neighborhood"
msgstr "" msgstr "私のお隣さん"
#: ../src/sugar/activity/activity.py:130 #: ../src/sugar/activity/activity.py:130
msgid "Keep" msgid "Keep"
msgstr "" msgstr "残しておく"
#: ../src/sugar/activity/activity.py:136 #: ../src/sugar/activity/activity.py:136
msgid "Stop" msgid "Stop"
msgstr "" msgstr "停止"
#: ../src/sugar/activity/activity.py:251 #: ../src/sugar/activity/activity.py:251
msgid "Undo" msgid "Undo"
msgstr "" msgstr "元に戻す"
#: ../src/sugar/activity/activity.py:256 #: ../src/sugar/activity/activity.py:256
msgid "Redo" msgid "Redo"
msgstr "" msgstr "やり直し"
#: ../src/sugar/activity/activity.py:266 #: ../src/sugar/activity/activity.py:266
msgid "Copy" msgid "Copy"
msgstr "" msgstr "コピー"
#: ../src/sugar/activity/activity.py:271 #: ../src/sugar/activity/activity.py:271
msgid "Paste" msgid "Paste"
msgstr "" msgstr "貼り付け"
#: ../src/sugar/activity/activity.py:297 #: ../src/sugar/activity/activity.py:297
msgid "Activity" msgid "Activity"
msgstr "" msgstr "アクティビティ"
#: ../src/sugar/activity/activity.py:469 #: ../src/sugar/activity/activity.py:469
#, python-format #, python-format
msgid "%s Activity" msgid "%s Activity"
msgstr "" msgstr "%s アクティビティ"
#: ../src/sugar/activity/activity.py:856 #: ../src/sugar/activity/activity.py:856
msgid "Keep error" msgid "Keep error"
@ -79,15 +78,15 @@ msgstr ""
#: ../src/sugar/graphics/alert.py:166 ../src/sugar/graphics/alert.py:209 #: ../src/sugar/graphics/alert.py:166 ../src/sugar/graphics/alert.py:209
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr "中止"
#: ../src/sugar/graphics/alert.py:170 ../src/sugar/graphics/alert.py:247 #: ../src/sugar/graphics/alert.py:170 ../src/sugar/graphics/alert.py:247
msgid "Ok" msgid "Ok"
msgstr "" msgstr "了解"
#: ../src/sugar/graphics/alert.py:219 #: ../src/sugar/graphics/alert.py:219
msgid "Continue" msgid "Continue"
msgstr "" msgstr "続ける"
#: ../src/sugar/util.py:181 #: ../src/sugar/util.py:181
msgid " and " msgid " and "
@ -100,7 +99,7 @@ msgstr ""
#. TRANS: Indicating something that just happened, eg. "just now", "moments ago" #. TRANS: Indicating something that just happened, eg. "just now", "moments ago"
#: ../src/sugar/util.py:185 #: ../src/sugar/util.py:185
msgid "Seconds ago" msgid "Seconds ago"
msgstr "" msgstr "ちょっと前"
#. TRANS: Indicating time passed, eg. "[10 day, 5 hours] ago", #. TRANS: Indicating time passed, eg. "[10 day, 5 hours] ago",
#. "[2 minutes] in the past", or "[3 years, 1 month] earlier" #. "[2 minutes] in the past", or "[3 years, 1 month] earlier"
@ -114,40 +113,34 @@ msgstr ""
#, python-format #, python-format
msgid "%d year" msgid "%d year"
msgid_plural "%d years" msgid_plural "%d years"
msgstr[0] "" msgstr[0] "%d 年"
msgstr[1] ""
#: ../src/sugar/util.py:203 #: ../src/sugar/util.py:203
#, python-format #, python-format
msgid "%d month" msgid "%d month"
msgid_plural "%d months" msgid_plural "%d months"
msgstr[0] "" msgstr[0] "%d 月"
msgstr[1] ""
#: ../src/sugar/util.py:204 #: ../src/sugar/util.py:204
#, python-format #, python-format
msgid "%d week" msgid "%d week"
msgid_plural "%d weeks" msgid_plural "%d weeks"
msgstr[0] "" msgstr[0] "%d 週"
msgstr[1] ""
#: ../src/sugar/util.py:205 #: ../src/sugar/util.py:205
#, python-format #, python-format
msgid "%d day" msgid "%d day"
msgid_plural "%d days" msgid_plural "%d days"
msgstr[0] "" msgstr[0] "%d 日"
msgstr[1] ""
#: ../src/sugar/util.py:206 #: ../src/sugar/util.py:206
#, python-format #, python-format
msgid "%d hour" msgid "%d hour"
msgid_plural "%d hours" msgid_plural "%d hours"
msgstr[0] "" msgstr[0] "%d 時間"
msgstr[1] ""
#: ../src/sugar/util.py:207 #: ../src/sugar/util.py:207
#, python-format #, python-format
msgid "%d minute" msgid "%d minute"
msgid_plural "%d minutes" msgid_plural "%d minutes"
msgstr[0] "" msgstr[0] "%d 分"
msgstr[1] ""

View File

@ -19,6 +19,7 @@
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
import os import os
import urllib
from sugar import env from sugar import env
from sugar.bundle.bundle import Bundle, NotInstalledException, \ from sugar.bundle.bundle import Bundle, NotInstalledException, \
@ -140,6 +141,11 @@ class ContentBundle(Bundle):
else: else:
self._bundle_class = None self._bundle_class = None
if cp.has_option(section, 'activity_start'):
self._activity_start = cp.get(section, 'activity_start')
else:
self._activity_start = 'index.html'
def get_name(self): def get_name(self):
return self._name return self._name
@ -167,6 +173,9 @@ class ContentBundle(Bundle):
def get_bundle_class(self): def get_bundle_class(self):
return self._bundle_class return self._bundle_class
def get_activity_start(self):
return self._activity_start
def _run_indexer(self): def _run_indexer(self):
xdg_data_dirs = os.getenv('XDG_DATA_DIRS', xdg_data_dirs = os.getenv('XDG_DATA_DIRS',
'/usr/local/share/:/usr/share/') '/usr/local/share/:/usr/share/')
@ -175,11 +184,19 @@ class ContentBundle(Bundle):
if os.path.exists(indexer): if os.path.exists(indexer):
os.spawnlp(os.P_WAIT, 'python', 'python', indexer) os.spawnlp(os.P_WAIT, 'python', 'python', indexer)
def get_root_dir(self):
return os.path.join(env.get_user_library_path(), self._zip_root_dir)
def get_start_path(self):
return os.path.join(self.get_root_dir(), self._activity_start)
def get_start_uri(self):
return "file://" + urllib.pathname2url(self.get_start_path())
def is_installed(self): def is_installed(self):
if self._unpacked: if self._unpacked:
return True return True
elif os.path.isdir(os.path.join(env.get_user_library_path(), elif os.path.isdir(self.get_root_dir()):
self._zip_root_dir)):
return True return True
else: else:
return False return False
@ -194,7 +211,6 @@ class ContentBundle(Bundle):
raise NotInstalledException raise NotInstalledException
install_dir = self._path install_dir = self._path
else: else:
install_dir = os.path.join(env.get_user_library_path(), install_dir = os.path.join(self.get_root_dir())
self._zip_root_dir)
self._uninstall(install_dir) self._uninstall(install_dir)
self._run_indexer() self._run_indexer()

View File

@ -169,6 +169,24 @@ class DSObject(object):
logging.debug('activityfactory.creating bundle with id %r', logging.debug('activityfactory.creating bundle with id %r',
bundle.get_bundle_id()) bundle.get_bundle_id())
activityfactory.create(bundle.get_bundle_id()) activityfactory.create(bundle.get_bundle_id())
elif self.is_content_bundle() and not bundle_id:
logging.debug('Creating content bundle')
bundle = ContentBundle(self.file_path)
if not bundle.is_installed():
logging.debug('Installing content bundle')
bundle.install()
activities = self._get_activities_for_mime('text/html')
if len(activities) == 0:
logging.warning('No activity can open HTML content bundles')
return
uri = bundle.get_start_uri()
logging.debug('activityfactory.creating with uri %s', uri)
activityfactory.create_with_uri(activities[0].bundle_id,
bundle.get_start_uri())
else: else:
if not self.get_activities() and bundle_id is None: if not self.get_activities() and bundle_id is None:
logging.warning('No activity can open this object, %s.' % logging.warning('No activity can open this object, %s.' %