update venv command

This commit is contained in:
utahta
2011-07-22 01:56:01 +09:00
parent 4aa62201c7
commit 9fbc3273cf
8 changed files with 135 additions and 58 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
import os
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
from pythonbrew.define import PATH_PYTHONS, PATH_BIN, PATH_VENVS
from pythonbrew.util import off, rm_r, Package, get_using_python_pkgname, unlink,\
is_installed
from pythonbrew.log import logger
@@ -17,6 +17,7 @@ class UninstallCommand(Command):
pkg = Package(arg)
pkgname = pkg.name
pkgpath = os.path.join(PATH_PYTHONS, pkgname)
venvpath = os.path.join(PATH_VENVS, pkgname)
if not is_installed(pkgname):
logger.info("`%s` is not installed." % pkgname)
continue
@@ -31,6 +32,7 @@ class UninstallCommand(Command):
if os.path.isfile(tgtpath) and os.path.samefile(path, tgtpath):
unlink(path)
rm_r(pkgpath)
rm_r(venvpath)
else:
self.parser.print_help()