diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-21 20:05:52 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-21 20:05:52 (GMT) |
commit | 9ea68051741d6e7b0bde4e6c7326cde4a14f6238 (patch) | |
tree | a41c5b1c25140173c90459ac58388002067f2c99 /shell/sugar | |
parent | f4e2791c897651d52980d35b84115e7c7f85a249 (diff) |
More work on packages refactoring, mostly working
Diffstat (limited to 'shell/sugar')
-rwxr-xr-x | shell/sugar | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/shell/sugar b/shell/sugar index ccfdd00..ad1905b 100755 --- a/shell/sugar +++ b/shell/sugar @@ -9,13 +9,6 @@ import pygtk pygtk.require('2.0') import gobject -def add_to_python_path(path): - sys.path.insert(0, path) - if os.environ.has_key('PYTHONPATH'): - os.environ['PYTHONPATH'] += ':' + path - else: - os.environ['PYTHONPATH'] = path - def start_dbus(): curdir = os.path.dirname(__file__) args = "/bin/dbus-daemon --session --print-address".split() @@ -60,16 +53,16 @@ if not os.environ.has_key("SUGAR_NICK_NAME"): curdir = os.path.abspath(os.path.dirname(__file__)) basedir = os.path.dirname(curdir) +import sugar.env + if os.path.isfile(os.path.join(basedir, 'sugar/__uninstalled__.py')): print 'Running sugar from ' + basedir + ' ...' - add_to_python_path(basedir) - add_to_python_path(os.path.join(basedir, 'shell')) - add_to_python_path(os.path.join(basedir, 'activities/browser')) + sugar.env.add_to_python_path(basedir) + sugar.env.add_to_python_path(os.path.join(basedir, 'shell')) else: + sugar.env.add_to_python_path(os.path.join(sugar.env.get_data_dir(), 'shell')) print 'Running the installed sugar...' -add_to_python_path(os.path.expanduser('~/.sugar/activities')) - print 'Redirecting output to the console, press ctrl+d to open it.' from session.session import Session |