From: Brian Dolbec Date: Fri, 11 Jan 2013 03:11:47 +0000 (-0800) Subject: new minimal start script X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=396287aae6d00407c34e7fc1e9fb96d462742094;p=catalyst.git new minimal start script --- diff --git a/bin/catalyst b/bin/catalyst new file mode 100755 index 00000000..a4e55db2 --- /dev/null +++ b/bin/catalyst @@ -0,0 +1,46 @@ +#!/usr/bin/python -OO + +# Maintained in full by: +# Catalyst Team +# Release Engineering Team +# Andrew Gaffney +# Chris Gianelloni +# $Id$ + + +from __future__ import print_function + +import sys + +__maintainer__="Catalyst " +__version__="2.0.12.2" + + +# This block ensures that ^C interrupts are handled quietly. +try: + import signal + + def exithandler(signum,frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGTERM, signal.SIG_IGN) + print() + sys.exit(1) + + signal.signal(signal.SIGINT, exithandler) + signal.signal(signal.SIGTERM, exithandler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + +except KeyboardInterrupt: + print() + sys.exit(1) + + +from catalyst.main import main + +try: + main() +except KeyboardInterrupt: + print("Aborted.") + sys.exit(130) +sys.exit(0) + diff --git a/catalyst/main.py b/catalyst/main.py old mode 100755 new mode 100644 index 2a9b75c8..763107b0 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -243,7 +243,7 @@ def build_target(addlargs, targetmap): addlargs["target"] sys.exit(1) -if __name__ == "__main__": +def main(): targetmap={} version()