This commit is contained in:
utahta
2011-07-19 23:17:29 +09:00
parent b039caf384
commit 219ad17459
18 changed files with 157 additions and 36 deletions
+3 -4
View File
@@ -2,7 +2,7 @@ import os
import sys
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
from pythonbrew.util import Package, set_current_path
from pythonbrew.util import Package, set_current_path, is_installed
from pythonbrew.log import logger
class SwitchCommand(Command):
@@ -16,11 +16,10 @@ class SwitchCommand(Command):
sys.exit(1)
pkg = Package(args[0])
pkgname = pkg.name
pkgdir = os.path.join(PATH_PYTHONS, pkgname)
if not os.path.isdir(pkgdir):
if not is_installed(pkgname):
logger.info("`%s` is not installed." % pkgname)
sys.exit(1)
pkgbin = os.path.join(pkgdir,'bin')
pkgbin = os.path.join(PATH_PYTHONS,pkgname,'bin')
set_current_path('%s:%s' % (PATH_BIN, pkgbin))