diff --git a/sugar-emulator b/sugar-emulator index b59d2588..dafc2751 100755 --- a/sugar-emulator +++ b/sugar-emulator @@ -25,10 +25,30 @@ if os.path.isfile(os.path.join(sourcedir, 'sugar/__uninstalled__.py')): sys.path.insert(0, sourcedir) else: print 'Running the installed sugar...' + sourcedir = None from sugar import env +from sugar import setup -env.setup_system() +if sourcedir: + bin_path = sourcedir + bin_path += ';' + os.path.join(sourcedir, 'shell') + bin_path += ';' + os.path.join(sourcedir, 'services/presence') + + if os.environ.has_key('PATH'): + old_path = os.environ['PATH'] + os.environ['PATH'] = bin_path + ':' + old_path + else: + os.environ['PATH'] = bin_path + + source = os.path.join(sourcedir, 'activities') + runner = os.path.join(sourcedir, 'shell/sugar-activity-factory') + setup.setup_activities(source, env.get_activity_info_dir(), runner) + + bin = os.path.join(sourcedir, + 'services/presence/sugar-presence-service') + setup.write_service('org.laptop.Presence', bin, + env.get_activity_info_dir()) from sugar.emulator import Emulator diff --git a/sugar/env.py b/sugar/env.py index e70fcba3..65081fc5 100644 --- a/sugar/env.py +++ b/sugar/env.py @@ -24,26 +24,6 @@ try: except ImportError: from sugar.__installed__ import * -import sugar.setup - -def setup_system(): - for path in sugar_bin_path: - if os.environ.has_key('PATH'): - old_path = os.environ['PATH'] - os.environ['PATH'] = path + ':' + old_path - else: - os.environ['PATH'] = path - - if sugar_source_dir: - source = os.path.join(sugar_source_dir, 'activities') - runner = os.path.join(sugar_source_dir, 'shell/sugar-activity-factory') - sugar.setup.setup_activities(source, get_activity_info_dir(), runner) - - bin = os.path.join(sugar_source_dir, - 'services/presence/sugar-presence-service') - sugar.setup.write_service('org.laptop.Presence', bin, - get_activity_info_dir()) - def get_profile_path(): if os.environ.has_key('SUGAR_PROFILE'): profile_id = os.environ['SUGAR_PROFILE']