From 396287aae6d00407c34e7fc1e9fb96d462742094 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Thu, 10 Jan 2013 19:11:47 -0800 Subject: [PATCH] new minimal start script --- bin/catalyst | 46 ++++++++++++++++++++++++++++++++++++++++++++++ catalyst/main.py | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 bin/catalyst mode change 100755 => 100644 catalyst/main.py 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() -- 2.26.2