Move the running from source dir hacks in the emulator.
This commit is contained in:
parent
9ca5c6c0bf
commit
ec3094e08b
@ -25,10 +25,30 @@ if os.path.isfile(os.path.join(sourcedir, 'sugar/__uninstalled__.py')):
|
|||||||
sys.path.insert(0, sourcedir)
|
sys.path.insert(0, sourcedir)
|
||||||
else:
|
else:
|
||||||
print 'Running the installed sugar...'
|
print 'Running the installed sugar...'
|
||||||
|
sourcedir = None
|
||||||
|
|
||||||
from sugar import env
|
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
|
from sugar.emulator import Emulator
|
||||||
|
|
||||||
|
20
sugar/env.py
20
sugar/env.py
@ -24,26 +24,6 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from sugar.__installed__ import *
|
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():
|
def get_profile_path():
|
||||||
if os.environ.has_key('SUGAR_PROFILE'):
|
if os.environ.has_key('SUGAR_PROFILE'):
|
||||||
profile_id = os.environ['SUGAR_PROFILE']
|
profile_id = os.environ['SUGAR_PROFILE']
|
||||||
|
Loading…
Reference in New Issue
Block a user