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
+4 -3
View File
@@ -1,7 +1,8 @@
import os
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
from pythonbrew.util import off, rm_r, Package, get_current_python_path, unlink
from pythonbrew.util import off, rm_r, Package, get_current_use_pkgname, unlink,\
is_installed
from pythonbrew.log import logger
class UninstallCommand(Command):
@@ -16,10 +17,10 @@ class UninstallCommand(Command):
pkg = Package(arg)
pkgname = pkg.name
pkgpath = os.path.join(PATH_PYTHONS, pkgname)
if not os.path.isdir(pkgpath):
if not is_installed(pkgname):
logger.info("`%s` is not installed." % pkgname)
continue
if get_current_python_path() == os.path.join(pkgpath,'bin','python'):
if get_current_use_pkgname() == pkgname:
off()
for d in os.listdir(PATH_BIN):
# remove symlink