From 2469c1a7af193ccdecb46bccbd4f5a37406a4943 Mon Sep 17 00:00:00 2001 From: utahta Date: Sun, 10 Jul 2011 21:17:05 +0900 Subject: [PATCH] update --- pythonbrew/__init__.py | 5 +++++ pythonbrew/commands/clean.py | 12 ------------ pythonbrew/commands/help.py | 2 +- pythonbrew/util.py | 4 ++-- 4 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 pythonbrew/commands/clean.py diff --git a/pythonbrew/__init__.py b/pythonbrew/__init__.py index 5e2f4d8..e09793c 100644 --- a/pythonbrew/__init__.py +++ b/pythonbrew/__init__.py @@ -1,6 +1,7 @@ import sys from pythonbrew.basecommand import command_dict, load_all_commands from pythonbrew.baseparser import parser +from pythonbrew.log import logger def main(): options, args = parser.parse_args(sys.argv[1:]) @@ -12,6 +13,10 @@ def main(): load_all_commands() command = args[0].lower() if command not in command_dict: + if command == 'clean': + # note: for some time + logger.info('\nDEPRECATION WARNING: `pythonbrew clean` has been renamed. Please run `pythonbrew cleanup` instead.\n') + return parser.error("Unknown command: `%s`" % command) return command = command_dict[command] diff --git a/pythonbrew/commands/clean.py b/pythonbrew/commands/clean.py deleted file mode 100644 index c967e76..0000000 --- a/pythonbrew/commands/clean.py +++ /dev/null @@ -1,12 +0,0 @@ -from pythonbrew.basecommand import Command -from pythonbrew.log import logger - -class CleanCommand(Command): - name = "clean" - usage = "%prog" - summary = "Remove stale source folders and archives" - - def run_command(self, options, args): - logger.info('\nDEPRECATION WARNING: `pythonbrew clean` has been renamed. Please run `pythonbrew cleanup` instead.\n') - -CleanCommand() diff --git a/pythonbrew/commands/help.py b/pythonbrew/commands/help.py index a3dda2a..7256ae4 100644 --- a/pythonbrew/commands/help.py +++ b/pythonbrew/commands/help.py @@ -22,6 +22,6 @@ class HelpCommand(Command): for command in commands: logger.info(" %s: %s" % (command.name, command.summary)) logger.info("\nFurther Instructions:") - logger.info(" http://github.com/utahta/pythonbrew") + logger.info(" https://github.com/utahta/pythonbrew") HelpCommand() diff --git a/pythonbrew/util.py b/pythonbrew/util.py index 45dadfe..457e936 100644 --- a/pythonbrew/util.py +++ b/pythonbrew/util.py @@ -215,8 +215,8 @@ def extract_downloadfile(content_type, download_file, target_dir): def get_current_python_path(): """return: python path or '' """ - p = subprocess.Popen(['command', '-v', 'python'], stdout=subprocess.PIPE) - return p.communicate()[0].strip() + p = subprocess.Popen('command -v python', stdout=subprocess.PIPE, shell=True) + return to_str(p.communicate()[0].strip()) def set_current_path(path): fp = open(PATH_ETC_CURRENT, 'w')