44 lines
856 B
Python
Executable File
44 lines
856 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import sys
|
|
import os
|
|
|
|
import pygtk
|
|
pygtk.require('2.0')
|
|
|
|
curdir = os.path.abspath(os.path.dirname(__file__))
|
|
sourcedir = os.path.dirname(curdir)
|
|
|
|
if os.path.isfile(os.path.join(sourcedir, 'sugar/__uninstalled__.py')):
|
|
print 'Running sugar from ' + sourcedir + ' ...'
|
|
sys.path.insert(0, sourcedir)
|
|
else:
|
|
print 'Running the installed sugar...'
|
|
|
|
from sugar import env
|
|
|
|
env.setup_system()
|
|
|
|
from session.Emulator import Emulator
|
|
|
|
if os.environ.has_key('SUGAR_EMULATOR') and \
|
|
os.environ['SUGAR_EMULATOR'] == 'yes':
|
|
emulator = Emulator()
|
|
emulator.start()
|
|
|
|
from FirstTimeDialog import FirstTimeDialog
|
|
import conf
|
|
|
|
profile = conf.get_profile()
|
|
if profile.get_nick_name() == None:
|
|
dialog = FirstTimeDialog()
|
|
dialog.run()
|
|
profile.save()
|
|
|
|
env.setup_user(profile)
|
|
|
|
from session.Session import Session
|
|
|
|
session = Session()
|
|
session.start()
|