mirror of
https://github.com/kennethreitz-archive/python-build.git
synced 2026-06-05 15:20:16 +00:00
update 0.6.6
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import os
|
||||
import sys
|
||||
from pythonbrew.basecommand import Command
|
||||
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
|
||||
from pythonbrew.util import Package, write_current
|
||||
from pythonbrew.define import PATH_PYTHONS, PATH_BIN, PATH_ETC_CURRENT
|
||||
from pythonbrew.util import Package
|
||||
from pythonbrew.log import logger
|
||||
|
||||
class SwitchCommand(Command):
|
||||
@@ -22,8 +22,14 @@ class SwitchCommand(Command):
|
||||
sys.exit(1)
|
||||
pkgbin = os.path.join(pkgdir,'bin')
|
||||
|
||||
write_current('%s:%s' % (PATH_BIN, pkgbin))
|
||||
self._set_current('%s:%s' % (PATH_BIN, pkgbin))
|
||||
|
||||
logger.info("Switched to %s" % pkgname)
|
||||
|
||||
def _set_current(self, path):
|
||||
fp = open(PATH_ETC_CURRENT, 'w')
|
||||
fp.write('PATH_PYTHONBREW="%s"\n' % (path))
|
||||
fp.close()
|
||||
|
||||
|
||||
SwitchCommand()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import os
|
||||
import sys
|
||||
from pythonbrew.basecommand import Command
|
||||
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
|
||||
from pythonbrew.util import Package, write_temp
|
||||
from pythonbrew.define import PATH_PYTHONS, PATH_BIN, PATH_ETC_TEMP
|
||||
from pythonbrew.util import Package
|
||||
from pythonbrew.log import logger
|
||||
|
||||
class UseCommand(Command):
|
||||
@@ -22,8 +22,14 @@ class UseCommand(Command):
|
||||
sys.exit(1)
|
||||
pkgbin = os.path.join(pkgdir,'bin')
|
||||
|
||||
write_temp('%s:%s' % (PATH_BIN, pkgbin))
|
||||
self._set_temp('%s:%s' % (PATH_BIN, pkgbin))
|
||||
|
||||
logger.info("Using `%s`" % pkgname)
|
||||
|
||||
def _set_temp(self, path):
|
||||
fp = open(PATH_ETC_TEMP, 'w')
|
||||
fp.write('PATH_PYTHONBREW="%s"\n' % (path))
|
||||
fp.close()
|
||||
|
||||
|
||||
UseCommand()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
VERSION = "0.6.5"
|
||||
VERSION = "0.6.6"
|
||||
|
||||
if os.environ.has_key("PYTHONBREW_ROOT"):
|
||||
ROOT = os.environ["PYTHONBREW_ROOT"]
|
||||
@@ -61,9 +61,11 @@ del _PYTHON_VERSIONS_LIST
|
||||
PYTHON_VERSION_URL["3.2a1"] = "http://www.python.org/ftp/python/3.2/Python-3.2a1.tgz"
|
||||
PYTHON_VERSION_URL["3.2a2"] = "http://www.python.org/ftp/python/3.2/Python-3.2a2.tgz"
|
||||
PYTHON_VERSION_URL["3.2a3"] = "http://www.python.org/ftp/python/3.2/Python-3.2a3.tgz"
|
||||
PYTHON_VERSION_URL["3.2a4"] = "http://www.python.org/ftp/python/3.2/Python-3.2a4.tgz"
|
||||
PYTHON_VERSION_URL["3.2b1"] = "http://www.python.org/ftp/python/3.2/Python-3.2b1.tgz"
|
||||
|
||||
LATEST_VERSIONS_OF_PYTHON = ['1.5.2', '1.6.1',
|
||||
'2.0.1', '2.1.3', '2.2.3', '2.3.7', '2.4.6', '2.5.5', '2.6.6', '2.7.1',
|
||||
'3.0.1', '3.1.3', '3.2a3']
|
||||
'3.0.1', '3.1.3', '3.2b1']
|
||||
|
||||
|
||||
|
||||
+1
-11
@@ -186,7 +186,7 @@ def untar_file(filename, location):
|
||||
tar.close()
|
||||
|
||||
def unpack_downloadfile(content_type, download_file, target_dir):
|
||||
logger.info("Extracting %s" % os.path.basename(download_file))
|
||||
logger.info("Extracting %s into %s" % (os.path.basename(download_file), target_dir))
|
||||
if is_gzip(content_type, download_file):
|
||||
untar_file(download_file, target_dir)
|
||||
else:
|
||||
@@ -202,16 +202,6 @@ def get_current_python_path():
|
||||
else:
|
||||
return None
|
||||
|
||||
def write_current(path):
|
||||
fp = open(PATH_ETC_CURRENT, 'w')
|
||||
fp.write('PATH_PYTHONBREW="%s"\n' % (path))
|
||||
fp.close()
|
||||
|
||||
def write_temp(path):
|
||||
fp = open(PATH_ETC_TEMP, '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