From a9265ec5d1f62d06c83d508f187372a4cf182ca3 Mon Sep 17 00:00:00 2001 From: volpino Date: Tue, 10 Jul 2012 18:14:41 +0200 Subject: [PATCH] euscan: Performance improvement moving imports Signed-off-by: volpino --- bin/euscan | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/euscan b/bin/euscan index 4bbbec9..ade3993 100755 --- a/bin/euscan +++ b/bin/euscan @@ -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