added use command. added some functions to bashrc.

This commit is contained in:
utahta
2010-11-25 01:12:24 +09:00
parent 159d839803
commit 611b71d635
14 changed files with 258 additions and 93 deletions
+4 -6
View File
@@ -2,7 +2,7 @@ import os
import sys
from pythonbrew.basecommand import Command
from pythonbrew.define import PATH_PYTHONS
from pythonbrew.util import off, rm_r, Package
from pythonbrew.util import off, rm_r, Package, get_current_python_path
from pythonbrew.log import logger
class UninstallCommand(Command):
@@ -14,14 +14,12 @@ class UninstallCommand(Command):
if args:
pkg = Package(args[0])
pkgname = pkg.name
pkgpath = "%s/%s" % (PATH_PYTHONS, pkgname)
pkgpath = os.path.join(PATH_PYTHONS, pkgname)
if not os.path.isdir(pkgpath):
logger.info("`%s` is not installed." % pkgname)
sys.exit(1)
if os.path.islink("%s/current" % PATH_PYTHONS):
curpath = os.path.realpath("%s/current" % PATH_PYTHONS)
if pkgpath == curpath:
off()
if get_current_python_path() == os.path.join(pkgpath,'bin','python'):
off()
rm_r(pkgpath)
else:
self.parser.print_help()