mirror of
https://github.com/kennethreitz-archive/python-build.git
synced 2026-06-05 23:30:18 +00:00
Bug fixed. Added tests.
This commit is contained in:
+7
-3
@@ -8,8 +8,7 @@ import tarfile
|
||||
import platform
|
||||
import urllib
|
||||
from subprocess import PIPE, Popen
|
||||
from pythonbrew.define import PATH_BIN, PATH_PYTHONS, PATH_ETC_CURRENT,\
|
||||
PATH_ETC_TEMP
|
||||
from pythonbrew.define import PATH_BIN, PATH_PYTHONS, PATH_ETC_CURRENT
|
||||
from pythonbrew.exceptions import ShellCommandException
|
||||
from pythonbrew.log import logger
|
||||
|
||||
@@ -108,7 +107,7 @@ def off():
|
||||
continue
|
||||
unlink("%s/%s" % (root, f))
|
||||
unlink("%s/current" % PATH_PYTHONS)
|
||||
write_current(PATH_BIN)
|
||||
set_current_path(PATH_BIN)
|
||||
|
||||
def split_leading_dir(path):
|
||||
path = str(path)
|
||||
@@ -202,6 +201,11 @@ def get_current_python_path():
|
||||
else:
|
||||
return None
|
||||
|
||||
def set_current_path(path):
|
||||
fp = open(PATH_ETC_CURRENT, 'w')
|
||||
fp.write('PATH_PYTHONBREW="%s"\n' % (path))
|
||||
fp.close()
|
||||
|
||||
def path_to_fileurl(path):
|
||||
path = os.path.normcase(os.path.abspath(path))
|
||||
url = urllib.quote(path)
|
||||
|
||||
Reference in New Issue
Block a user