Permalink
Browse files

Reorganized some imports

  • Loading branch information...
1 parent dc1da11 commit 8f3b2e157c68038201f4551a8d52ecdc425f16f4 @saghul committed Mar 31, 2012
View
@@ -1,11 +1,13 @@
-import sys
import os
+import sys
+
from pythonz.basecommand import command_dict, load_all_commands
from pythonz.baseparser import parser
from pythonz.define import PATH_HOME_ETC
from pythonz.util import makedirs
+
def init_home():
if not os.path.isdir(PATH_HOME_ETC):
makedirs(PATH_HOME_ETC)
View
@@ -1,10 +1,12 @@
import os
-import sys
import re
+import sys
+
from optparse import OptionParser
from pythonz import commands
+
command_dict = {}
class Command(object):
@@ -1,9 +1,11 @@
import os
+
from pythonz.basecommand import Command
from pythonz.define import PATH_BUILD, PATH_DISTS
from pythonz.util import rm_r
+
class CleanupCommand(Command):
name = "cleanup"
usage = "%prog"
View
@@ -3,6 +3,7 @@
from pythonz.baseparser import parser
from pythonz.log import logger
+
class HelpCommand(Command):
name = "help"
usage = "%prog [COMMAND]"
@@ -1,9 +1,11 @@
import sys
+
from pythonz.basecommand import Command
from pythonz.installer.pythoninstaller import PythonInstaller, PythonInstallerMacOSX
from pythonz.util import is_macosx
+
class InstallCommand(Command):
name = "install"
usage = "%prog [OPTIONS] VERSION"
View
@@ -1,10 +1,12 @@
import os
+
from pythonz.basecommand import Command
from pythonz.define import PYTHON_VERSIONS_URLS, PATH_PYTHONS
from pythonz.util import get_using_python_pkgname
from pythonz.log import logger
+
class ListCommand(Command):
name = "list"
usage = "%prog"
View
@@ -2,6 +2,7 @@
from pythonz.basecommand import Command
from pythonz.util import off
+
class OffCommand(Command):
name = "off"
usage = "%prog"
@@ -1,10 +1,12 @@
import os
+
from pythonz.basecommand import Command
from pythonz.define import PATH_PYTHONS
from pythonz.util import off, rm_r, Package, get_using_python_pkgname, is_installed
from pythonz.log import logger
+
class UninstallCommand(Command):
name = "uninstall"
usage = "%prog VERSION"
@@ -1,12 +1,14 @@
import os
import sys
+
from pythonz.basecommand import Command
from pythonz.define import PATH_DISTS, ROOT, PATH_BUILD, PYTHONZ_UPDATE_URL, PYTHONZ_UPDATE_URL_CONFIG, PATH_ETC_CONFIG
from pythonz.log import logger
from pythonz.downloader import Downloader, get_headerinfo_from_url
from pythonz.util import rm_r, extract_downloadfile, Link, unlink, Subprocess
+
class UpdateCommand(Command):
name = "update"
usage = "%prog"
View
@@ -1,11 +1,13 @@
import os
import sys
+
from pythonz.basecommand import Command
from pythonz.define import PATH_PYTHONS, PATH_HOME_ETC_TEMP
from pythonz.util import Package
from pythonz.log import logger
+
class UseCommand(Command):
name = "use"
usage = "%prog VERSION"
View
@@ -1,8 +1,10 @@
-import sys
import re
+import sys
import subprocess
+
from subprocess import Popen, PIPE
+
from pythonz.log import logger
from pythonz.util import to_str
from pythonz.exceptions import CurlFetchException
@@ -3,6 +3,7 @@
from pythonz.log import logger
from pythonz.define import INSTALLER_ROOT, ROOT, PATH_ETC
+
def install_pythonz():
PythonzInstaller.install(INSTALLER_ROOT)
# for bash
@@ -5,6 +5,7 @@
import mimetypes
import multiprocessing
import re
+
from pythonz.util import symlink, Package, is_url, Link,\
unlink, is_html, Subprocess, rm_r, is_python26, is_python27,\
extract_downloadfile, is_archive_file, path_to_fileurl, is_file,\
@@ -16,6 +17,7 @@
from pythonz.log import logger
from pythonz.exceptions import UnknownVersionException
+
class PythonInstaller(object):
"""Python installer
"""
@@ -5,13 +5,15 @@
import shutil
import stat
import time
+
from pythonz.util import makedirs, rm_r
from pythonz.define import PATH_BUILD, PATH_BIN, PATH_DISTS, PATH_PYTHONS,\
PATH_ETC, PATH_SCRIPTS, PATH_SCRIPTS_PYTHONZ,\
PATH_SCRIPTS_PYTHONZ_COMMANDS, PATH_BIN_PYTHONZ,\
PATH_LOG, PATH_PATCHES, PATH_ETC_CONFIG,\
PATH_SCRIPTS_PYTHONZ_INSTALLER, PATH_HOME_ETC, ROOT
+
class PythonzInstaller(object):
"""pythonz installer:
"""
View
@@ -11,11 +11,14 @@
import subprocess
import shlex
import select
+
from urllib2 import urlparse
+
from pythonz.define import PATH_BIN, PATH_HOME_ETC_CURRENT, PATH_PYTHONS
from pythonz.exceptions import ShellCommandException
from pythonz.log import logger
+
def size_format(b):
kb = 1000
mb = kb*kb
View
@@ -1,6 +1,6 @@
-from pythonz.installer import install_pythonz, upgrade_pythonz, systemwide_pythonz
from optparse import OptionParser
+from pythonz.installer import install_pythonz, upgrade_pythonz, systemwide_pythonz
if __name__ == "__main__":
parser = OptionParser()

0 comments on commit 8f3b2e1

Please sign in to comment.