From 6e65138dca20e5705720fa3f51761348ab1e604d Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Mon, 8 Oct 2007 14:52:50 +0200 Subject: [PATCH] Added --license switch to the Gui. --- gui/Scyther/Scyther.py | 12 ++++++++++++ gui/scyther-gui.py | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/gui/Scyther/Scyther.py b/gui/Scyther/Scyther.py index 01454fe..7970506 100755 --- a/gui/Scyther/Scyther.py +++ b/gui/Scyther/Scyther.py @@ -409,6 +409,18 @@ def GetInfo(html=False): return html +def GetLicense(): + """ + Retrieve license information. + """ + + program = getScytherBackend() + arg = "--license" + sc = Scyther() + (output,errors) = sc.doScytherCommand(spdl=None, args=arg) + return output + + #--------------------------------------------------------------------------- # vim: set ts=4 sw=4 et list lcs=tab\:>-: diff --git a/gui/scyther-gui.py b/gui/scyther-gui.py index 9f2c84e..adcc5f7 100755 --- a/gui/scyther-gui.py +++ b/gui/scyther-gui.py @@ -63,6 +63,10 @@ def parseArgs(): parser.add_option("-c","--check",dest="command",default=None,action="store_const",const="check", help="Immediately check protocol (requires input file)") + # License + parser.add_option("-l","--license",dest="license",default=False,action="store_const",const=True, + help="Show license") + # no-splash parser.add_option("-N","--no-splash",dest="splashscreen",default=True,action="store_const",const=False, help="Do not show the splash screen") @@ -123,6 +127,11 @@ class ScytherApp(wx.App): basedir = os.path.abspath(os.path.dirname(sys.argv[0])) (opts,args) = parseArgs() + # License option may abort here + if opts.license: + print Scyther.GetLicense() + sys.exit(0) + # Load preferences file Preference.init()