def installed(self): logger.log("# Installed Python versions") cur = get_using_python_pkgname() for d in sorted(os.listdir(PATH_PYTHONS)): if cur and cur == d: logger.log(' %s (*)' % d) else: logger.log(' %s' % d)
def run_command(self, options, args): if args: # Uninstall pythons for arg in args: pkg = Package(arg, options.type) pkgname = pkg.name if not is_installed(pkg): logger.error("`%s` is not installed." % pkgname) continue if get_using_python_pkgname() == pkgname: off() rm_r(os.path.join(PATH_PYTHONS, pkgname)) else: self.parser.print_help()