euscan: Performance improvement moving imports

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-07-10 18:14:41 +02:00
parent 3f0cef09e0
commit a9265ec5d1
1 changed files with 6 additions and 3 deletions

View File

@ -28,12 +28,10 @@ from portage.output import white, yellow, turquoise, green
from portage.exception import AmbiguousPackageName
from gentoolkit import pprinter as pp
from gentoolkit.eclean.search import (port_settings)
from gentoolkit.eclean.search import port_settings
from gentoolkit.errors import GentoolkitException
from euscan import CONFIG, output
from euscan.scan import scan_upstream
from euscan.out import progress_bar
# Globals
@ -216,6 +214,7 @@ def parse_args():
def main():
"""Parse command line and execute all actions."""
CONFIG['nocolor'] = (
port_settings["NOCOLOR"] in ('yes', 'true') or not isatty
)
@ -242,6 +241,10 @@ def main():
print_usage(e.value)
exit_helper(EINVAL)
# Importing stuff here for performance reasons
from euscan.scan import scan_upstream
from euscan.out import progress_bar
if CONFIG['verbose'] > 2:
HTTPConnection.debuglevel = 1