From 7b2ae023bfe90af1f9e54527c6065bb2f96a801b Mon Sep 17 00:00:00 2001 From: utahta Date: Tue, 7 Dec 2010 16:16:19 +0900 Subject: [PATCH] update 0.6.6 --- ChangeLog | 3 +++ PKG-INFO | 8 ++++++-- README.rst | 8 ++++++-- pythonbrew/commands/switch.py | 12 +++++++++--- pythonbrew/commands/use.py | 12 +++++++++--- pythonbrew/define.py | 6 ++++-- pythonbrew/util.py | 12 +----------- stable-version.txt | 2 +- 8 files changed, 39 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1cfcaa0..f52604a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* 0.6.6 + - Added py command + * 0.6.5 - Supported file: URIs diff --git a/PKG-INFO b/PKG-INFO index a575371..4f200e8 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -35,12 +35,12 @@ Install some Pythons:: pythonbrew install file:///path/to/Python-2.7.tgz pythonbrew install /path/to/Python-2.7.tgz -Switch python in the $PATH:: +Switch python in the PATH:: pythonbrew switch 2.6.6 pythonbrew switch 2.5.5 -Using python in the PATH:: +Using python in the PATH (current shell only):: pythonbrew use 2.6.6 @@ -96,6 +96,10 @@ switch use Using the given version of python. + (current shell only) + +py + Runs a named python file against specified and/or all pythons. list List the installed all pythons. diff --git a/README.rst b/README.rst index b2d3093..ed72020 100644 --- a/README.rst +++ b/README.rst @@ -34,12 +34,12 @@ Install some Pythons:: pythonbrew install file:///path/to/Python-2.7.tgz pythonbrew install /path/to/Python-2.7.tgz -Switch python in the $PATH:: +Switch python in the PATH:: pythonbrew switch 2.6.6 pythonbrew switch 2.5.5 -Using python in the PATH:: +Using python in the PATH (current shell only):: pythonbrew use 2.6.6 @@ -95,6 +95,10 @@ switch use Using the given version of python. + (current shell only) + +py + Runs a named python file against specified and/or all pythons. list List the installed all pythons. diff --git a/pythonbrew/commands/switch.py b/pythonbrew/commands/switch.py index b4fc0b9..6ad1ffe 100644 --- a/pythonbrew/commands/switch.py +++ b/pythonbrew/commands/switch.py @@ -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() diff --git a/pythonbrew/commands/use.py b/pythonbrew/commands/use.py index 36268b9..bbea076 100644 --- a/pythonbrew/commands/use.py +++ b/pythonbrew/commands/use.py @@ -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() diff --git a/pythonbrew/define.py b/pythonbrew/define.py index c12a3bd..7933d20 100644 --- a/pythonbrew/define.py +++ b/pythonbrew/define.py @@ -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'] diff --git a/pythonbrew/util.py b/pythonbrew/util.py index d9605c1..9b83163 100644 --- a/pythonbrew/util.py +++ b/pythonbrew/util.py @@ -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) diff --git a/stable-version.txt b/stable-version.txt index e0ea44c..bf21f52 100644 --- a/stable-version.txt +++ b/stable-version.txt @@ -1 +1 @@ -0.6.5 \ No newline at end of file +0.6.6 \ No newline at end of file