From c7f6e18b535e7058b593424840559e02ddbd8b05 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Mon, 19 Nov 2012 23:14:00 +0100 Subject: [PATCH] add -c cmd-opt --- Qwad.pyw | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Qwad.pyw b/Qwad.pyw index 87dc8c6..9a492c4 100644 --- a/Qwad.pyw +++ b/Qwad.pyw @@ -37,6 +37,8 @@ def main(): help='IOS ') parser.add_option('-g', "--getversions", dest="getversions", action="store_true", default=False, help="get available versions for IOS") + parser.add_option('-c', "--convert", dest="convert", + action="store_true", default=False, help="convert between IOSX and xxxxxxx-xxxxxxx") parser.add_option("-v", "--version", dest="version", action="store_true", default=False, help="print version and exit") @@ -65,6 +67,16 @@ def main(): print "Available Versions for %s: %s" % (str(args[0]), IOSdict[str(xarg)]) sys.exit(0) + if options.convert: + if "IOS" in str(args[0]): + print "%s == %s" % (str(args[0]), TitleDict[str(args[0])]) + else: + NewDict = swap_dic(TitleDict) + xarg = NewDict[str(args[0])] + print "%s == %s" % (str(args[0]), xarg) + sys.exit(0) + + os.chdir(os.getenv("HOME")) translator = QTranslator() translator.load(QString("i18n/Qwad_%1").arg(QLocale.system().name()))