Make paths manipulation stuff private
This commit is contained in:
parent
93d489741d
commit
e34d437fb9
28
sugar/env.py
28
sugar/env.py
@ -9,27 +9,21 @@ except ImportError:
|
||||
|
||||
import sugar.setup
|
||||
|
||||
def add_to_python_path(path):
|
||||
sys.path.insert(0, path)
|
||||
if os.environ.has_key('PYTHONPATH'):
|
||||
old_path = os.environ['PYTHONPATH']
|
||||
os.environ['PYTHONPATH'] = path + ':' + old_path
|
||||
else:
|
||||
os.environ['PYTHONPATH'] = path
|
||||
|
||||
def add_to_bin_path(path):
|
||||
if os.environ.has_key('PATH'):
|
||||
old_path = os.environ['PATH']
|
||||
os.environ['PATH'] = path + ':' + old_path
|
||||
else:
|
||||
os.environ['PATH'] = path
|
||||
|
||||
def setup():
|
||||
for path in sugar_python_path:
|
||||
add_to_python_path(path)
|
||||
sys.path.insert(0, path)
|
||||
if os.environ.has_key('PYTHONPATH'):
|
||||
old_path = os.environ['PYTHONPATH']
|
||||
os.environ['PYTHONPATH'] = path + ':' + old_path
|
||||
else:
|
||||
os.environ['PYTHONPATH'] = path
|
||||
|
||||
for path in sugar_bin_path:
|
||||
add_to_bin_path(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')
|
||||
|
Loading…
Reference in New Issue
Block a user