From: Brian Dolbec <[email protected]> W. Trevor King: Refactored Git history for Brian Dolbec's content changes.
Signed-off-by: W. Trevor King <[email protected]> --- catalyst | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/catalyst b/catalyst index 38fbdfb..3983155 100755 --- a/catalyst +++ b/catalyst @@ -80,7 +80,8 @@ def parse_config(myconfig): # first, try the one passed (presumably from the cmdline) if myconfig: if os.path.exists(myconfig): - print "Using command line specified Catalyst configuration file, "+myconfig + print "Using command line specified Catalyst configuration file, " + \ + myconfig config_file=myconfig else: @@ -90,7 +91,8 @@ def parse_config(myconfig): # next, try the default location elif os.path.exists("/etc/catalyst/catalyst.conf"): - print "Using default Catalyst configuration file, /etc/catalyst/catalyst.conf" + print "Using default Catalyst configuration file," + \ + " /etc/catalyst/catalyst.conf" config_file="/etc/catalyst/catalyst.conf" # can't find a config file (we are screwed), so bail out @@ -186,14 +188,16 @@ def parse_config(myconfig): conf_values["port_logdir"]=myconf["port_logdir"]; def import_modules(): - # import catalyst's own modules (i.e. catalyst_support and the arch modules) + # import catalyst's own modules + # (i.e. catalyst_support and the arch modules) targetmap={} try: for x in required_build_targets: try: fh=open(conf_values["sharedir"]+"/modules/"+x+".py") - module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE)) + module = imp.load_module(x,fh,"modules/" + x + ".py", + (".py","r",imp.PY_SOURCE)) fh.close() except IOError: @@ -203,7 +207,8 @@ def import_modules(): for x in valid_build_targets: try: fh=open(conf_values["sharedir"]+"/modules/"+x+".py") - module=imp.load_module(x,fh,"modules/"+x+".py",(".py","r",imp.PY_SOURCE)) + module = imp.load_module(x,fh,"modules/" + x + ".py", + (".py","r",imp.PY_SOURCE)) module.register(targetmap) fh.close() @@ -221,15 +226,17 @@ def import_modules(): def build_target(addlargs, targetmap): try: if addlargs["target"] not in targetmap: - raise CatalystError,"Target \""+addlargs["target"]+"\" not available." + raise CatalystError, \ + "Target \"%s\" not available." % addlargs["target"] mytarget=targetmap[addlargs["target"]](conf_values, addlargs) mytarget.run() except: - modules.catalyst.util.print_traceback() - print "!!! catalyst: Error encountered during run of target " + addlargs["target"] + catalyst.util.print_traceback() + print "!!! catalyst: Error encountered during run of target " + \ + addlargs["target"] sys.exit(1) if __name__ == "__main__": @@ -248,8 +255,12 @@ if __name__ == "__main__": # parse out the command line arguments try: - opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge", "purgeonly", "purgetmponly", "help", "version", "debug",\ - "clear-autoresume", "config=", "cli=", "file=", "fetch", "verbose","snapshot="]) + opts,args = getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", + ["purge", "purgeonly", "purgetmponly", "help", "version", "debug", + "clear-autoresume", "config=", "cli=", "file=", "fetch", + "verbose","snapshot=" + ] + ) except getopt.GetoptError: usage() -- 1.8.3.2
