diff --git a/pythonbrew/commands/list.py b/pythonbrew/commands/list.py index 91dfa6f..89c9f08 100644 --- a/pythonbrew/commands/list.py +++ b/pythonbrew/commands/list.py @@ -9,7 +9,7 @@ class ListCommand(Command): name = "list" usage = "%prog [VERSION]" - summary = "List the installed all pythons" + summary = "List the installed all pythonidae" def __init__(self): super(ListCommand, self).__init__() @@ -35,7 +35,7 @@ def run_command(self, options, args): self.installed(options, args) def installed(self, options, args): - logger.log("# pythonbrew pythons") + logger.log("# pythonbrew pythonidae") cur = get_using_python_pkgname() for d in sorted(os.listdir(PATH_PYTHONS)): if cur and cur == d: diff --git a/pythonbrew/commands/py.py b/pythonbrew/commands/py.py index 102cb79..9a08084 100644 --- a/pythonbrew/commands/py.py +++ b/pythonbrew/commands/py.py @@ -9,13 +9,13 @@ class PyCommand(Command): name = "py" usage = "%prog PYTHON_FILE" - summary = "Runs a named python file against specified and/or all pythons" + summary = "Runs a named python file against specified and/or all pythonidae" def __init__(self): super(PyCommand, self).__init__() self.parser.add_option( "-p", "--python", - dest="pythons", + dest="pythonidae", action="append", default=[], help="Use the specified python version.", @@ -34,8 +34,8 @@ def run_command(self, options, args): if not args: self.parser.print_help() sys.exit(1) - pythons = self._get_pythons(options.pythons) - for d in pythons: + pythonidae = self._get_pythonidae(options.pythonidae) + for d in pythonidae: if options.verbose: logger.info('`%s` running...' % d) path = os.path.join(PATH_PYTHONS, d, 'bin', args[0]) @@ -48,9 +48,9 @@ def run_command(self, options, args): else: logger.error('%s: No such file or directory.' % path) - def _get_pythons(self, _pythons): - pythons = [Package(p).name for p in _pythons] + def _get_pythonidae(self, _pythonidae): + pythonidae = [Package(p).name for p in _pythonidae] return [d for d in sorted(os.listdir(PATH_PYTHONS)) - if not pythons or d in pythons] + if not pythonidae or d in pythonidae] PyCommand() diff --git a/pythonbrew/commands/symlink.py b/pythonbrew/commands/symlink.py index f87da05..d8a9528 100644 --- a/pythonbrew/commands/symlink.py +++ b/pythonbrew/commands/symlink.py @@ -15,7 +15,7 @@ def __init__(self): super(SymlinkCommand, self).__init__() self.parser.add_option( "-p", "--python", - dest="pythons", + dest="pythonidae", action="append", default=[], help="Use the specified python version.", @@ -44,16 +44,16 @@ def __init__(self): def run_command(self, options, args): if options.default: # create only one instance as default of an application. - pythons = self._get_pythons([options.default]) - for pkgname in pythons: + pythonidae = self._get_pythonidae([options.default]) + for pkgname in pythonidae: if args: bin = args[0] self._symlink(bin, bin, pkgname) else: self._symlink('python', 'py', pkgname) elif options.venv: - if options.pythons: - pkgname = Package(options.pythons[0]).name + if options.pythonidae: + pkgname = Package(options.pythonidae[0]).name else: pkgname = get_using_python_pkgname() if not is_installed(pkgname): @@ -74,8 +74,8 @@ def run_command(self, options, args): dstbin = 'py%s-%s' % (pkg.version, options.venv) self._symlink('python', dstbin, pkgname) else: - pythons = self._get_pythons(options.pythons) - for pkgname in pythons: + pythonidae = self._get_pythonidae(options.pythonidae) + for pkgname in pythonidae: if options.remove: # remove symlinks for bin in os.listdir(PATH_BIN): @@ -107,11 +107,11 @@ def _symlink(self, srcbin, dstbin, pkgname): else: logger.error("%s was not found in your path." % src) - def _get_pythons(self, _pythons): + def _get_pythonidae(self, _pythonidae): """Get the installed python versions list. """ - pythons = [Package(p).name for p in _pythons] + pythonidae = [Package(p).name for p in _pythonidae] return [d for d in sorted(os.listdir(PATH_PYTHONS)) - if not pythons or d in pythons] + if not pythonidae or d in pythonidae] SymlinkCommand() diff --git a/pythonbrew/commands/uninstall.py b/pythonbrew/commands/uninstall.py index 0699224..e8c51b0 100644 --- a/pythonbrew/commands/uninstall.py +++ b/pythonbrew/commands/uninstall.py @@ -12,7 +12,7 @@ class UninstallCommand(Command): def run_command(self, options, args): if args: - # Uninstall pythons + # Uninstall pythonidae for arg in args: pkg = Package(arg) pkgname = pkg.name diff --git a/pythonbrew/commands/venv.py b/pythonbrew/commands/venv.py index 8f4359e..fd8c607 100644 --- a/pythonbrew/commands/venv.py +++ b/pythonbrew/commands/venv.py @@ -4,7 +4,7 @@ from pythonbrew.define import PATH_PYTHONS, PATH_VENVS, PATH_HOME_ETC_VENV,\ PATH_ETC, VIRTUALENV_DLSITE, PATH_DISTS from pythonbrew.util import Package, \ - is_installed, get_installed_pythons_pkgname, get_using_python_pkgname,\ + is_installed, get_installed_pythonidae_pkgname, get_using_python_pkgname,\ untar_file, Subprocess, rm_r from pythonbrew.log import logger from pythonbrew.downloader import Downloader @@ -175,7 +175,7 @@ def run_command_use(self, options, args): def run_command_list(self, options, args): if options.all: - for pkgname in get_installed_pythons_pkgname(): + for pkgname in get_installed_pythonidae_pkgname(): workon_home = os.path.join(PATH_VENVS, pkgname) logger.log("# virtualenv for %(pkgname)s (found in %(workon_home)s)" % {'pkgname': pkgname, 'workon_home': workon_home}) if os.path.isdir(workon_home): diff --git a/pythonbrew/define.py b/pythonbrew/define.py index da632f6..e072b07 100644 --- a/pythonbrew/define.py +++ b/pythonbrew/define.py @@ -18,7 +18,7 @@ ROOT = os.path.join(os.environ["HOME"],".pythonbrew") # directories -PATH_PYTHONS = os.path.join(ROOT,"pythons") +PATH_PYTHONS = os.path.join(ROOT,"pythonidae") PATH_BUILD = os.path.join(ROOT,"build") PATH_DISTS = os.path.join(ROOT,"dists") PATH_ETC = os.path.join(ROOT,"etc") diff --git a/pythonbrew/installer/__init__.py b/pythonbrew/installer/__init__.py index 1568ae2..4cddd7f 100644 --- a/pythonbrew/installer/__init__.py +++ b/pythonbrew/installer/__init__.py @@ -20,7 +20,7 @@ def install_pythonbrew(): [[ -s "%(PATH_ETC)s/%(shrc)s" ]] && source "%(PATH_ETC)s/%(shrc)s" After that, exit this shell, start a new one, and install some fresh -pythons: +pythonidae: pythonbrew install 2.7.2 pythonbrew install 3.2 @@ -48,7 +48,7 @@ def systemwide_pythonbrew(): %(ROOT)s After that, exit this shell, start a new one, and install some fresh -pythons: +pythonidae: pythonbrew install 2.7.2 pythonbrew install 3.2 diff --git a/pythonbrew/util.py b/pythonbrew/util.py index f4e301e..860b4cd 100644 --- a/pythonbrew/util.py +++ b/pythonbrew/util.py @@ -239,7 +239,7 @@ def get_using_python_pkgname(): return None -def get_installed_pythons_pkgname(): +def get_installed_pythonidae_pkgname(): """Get the installed python versions list.""" return [d for d in sorted(os.listdir(PATH_PYTHONS))] diff --git a/tests/test_suite.py b/tests/test_suite.py index 1cd0b21..8c3a5ed 100644 --- a/tests/test_suite.py +++ b/tests/test_suite.py @@ -92,7 +92,7 @@ def test_08_py(): fp.close() # Runs the python script c = PyCommand() - c.run_command(Options({'pythons':[], 'verbose':False, 'bin':"python", 'options':""}), + c.run_command(Options({'pythonidae':[], 'verbose':False, 'bin':"python", 'options':""}), [TESTPY_FILE]) def test_09_buildout():