Rework sugar.logger and make activities just

redirect their output to a log.
This commit is contained in:
Marco Pesenti Gritti
2007-10-09 18:58:39 +02:00
parent b03cf6c5e8
commit b44a2916ba
6 changed files with 61 additions and 191 deletions
+4 -3
View File
@@ -25,12 +25,13 @@ import pygtk
pygtk.require('2.0')
import gtk
import dbus
import dbus.service
import dbus.glib
from sugar import logger
from sugar.activity import activityhandle
from sugar.bundle.activitybundle import ActivityBundle
from sugar import _sugarext
from sugar import logger
activity_instances = []
@@ -80,6 +81,8 @@ parser.add_option('-s', '--single-process', dest='single_process',
help='start all the instances in the same process')
(options, args) = parser.parse_args()
logger.start()
if 'SUGAR_BUNDLE_PATH' not in os.environ:
print 'SUGAR_BUNDLE_PATH is not defined in the environment.'
sys.exit(1)
@@ -93,8 +96,6 @@ sys.path.append(bundle_path)
bundle = ActivityBundle(bundle_path)
logger.start(bundle.get_bundle_id())
gettext.bindtextdomain(bundle.get_bundle_id(),
bundle.get_locale_path())
gettext.textdomain(bundle.get_bundle_id())