Get rid of the global python path extensions
This commit is contained in:
parent
77f2de8f73
commit
0836c57f76
@ -19,9 +19,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
curdir = os.path.abspath(os.path.dirname(__file__))
|
sourcedir = os.path.abspath(os.path.dirname(__file__))
|
||||||
sourcedir = os.path.dirname(curdir)
|
|
||||||
|
|
||||||
if os.path.isfile(os.path.join(sourcedir, 'sugar/__uninstalled__.py')):
|
if os.path.isfile(os.path.join(sourcedir, 'sugar/__uninstalled__.py')):
|
||||||
print 'Running sugar from ' + sourcedir + ' ...'
|
print 'Running sugar from ' + sourcedir + ' ...'
|
||||||
sys.path.insert(0, sourcedir)
|
sys.path.insert(0, sourcedir)
|
||||||
|
@ -5,6 +5,4 @@ sugar_activity_info_dir = '@prefix@/share/sugar/activities'
|
|||||||
sugar_services_dir = '@prefix@/share/sugar/services'
|
sugar_services_dir = '@prefix@/share/sugar/services'
|
||||||
sugar_dbus_config = '@prefix@/share/sugar/dbus-installed.conf'
|
sugar_dbus_config = '@prefix@/share/sugar/dbus-installed.conf'
|
||||||
|
|
||||||
sugar_python_path = ['@prefix@/share/sugar/activities']
|
|
||||||
|
|
||||||
sugar_bin_path = []
|
sugar_bin_path = []
|
||||||
|
@ -10,9 +10,6 @@ sugar_activity_info_dir = __tmpdir
|
|||||||
|
|
||||||
sugar_dbus_config = os.path.join(sugar_source_dir, 'dbus-uninstalled.conf')
|
sugar_dbus_config = os.path.join(sugar_source_dir, 'dbus-uninstalled.conf')
|
||||||
|
|
||||||
sugar_python_path = []
|
|
||||||
sugar_python_path.append(os.path.join(sugar_source_dir, 'activities'))
|
|
||||||
|
|
||||||
sugar_bin_path = []
|
sugar_bin_path = []
|
||||||
sugar_bin_path.append(os.path.join(sugar_source_dir))
|
sugar_bin_path.append(os.path.join(sugar_source_dir))
|
||||||
sugar_bin_path.append(os.path.join(sugar_source_dir, 'shell'))
|
sugar_bin_path.append(os.path.join(sugar_source_dir, 'shell'))
|
||||||
|
10
sugar/env.py
10
sugar/env.py
@ -26,17 +26,7 @@ except ImportError:
|
|||||||
|
|
||||||
import sugar.setup
|
import sugar.setup
|
||||||
|
|
||||||
def setup_python_path():
|
|
||||||
for path in sugar_python_path:
|
|
||||||
if os.environ.has_key('PYTHONPATH'):
|
|
||||||
old_path = os.environ['PYTHONPATH']
|
|
||||||
os.environ['PYTHONPATH'] = path + ':' + old_path
|
|
||||||
else:
|
|
||||||
os.environ['PYTHONPATH'] = path
|
|
||||||
|
|
||||||
def setup_system():
|
def setup_system():
|
||||||
setup_python_path()
|
|
||||||
|
|
||||||
for path in sugar_bin_path:
|
for path in sugar_bin_path:
|
||||||
if os.environ.has_key('PATH'):
|
if os.environ.has_key('PATH'):
|
||||||
old_path = os.environ['PATH']
|
old_path = os.environ['PATH']
|
||||||
|
Loading…
Reference in New Issue
Block a user