X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Fgnunet-qr.py.in;h=ced7a5441155a0222c8ddcaa0c3506b6ef9155f9;hb=4707789ebfb4cef9672db31e3ceb8f98381901d0;hp=6f6118b28c955cb930265dc12fde535552ecfc7b;hpb=2c30f1f771195b1be3439908d2291bcc717986bb;p=oweals%2Fgnunet.git diff --git a/src/util/gnunet-qr.py.in b/src/util/gnunet-qr.py.in index 6f6118b28..ced7a5441 100755 --- a/src/util/gnunet-qr.py.in +++ b/src/util/gnunet-qr.py.in @@ -1,13 +1,13 @@ -#@PYTHON@ +#!@PYTHON@ import sys import getopt import subprocess from sys import argv try: - import zbar + import zbar except ImportError as e: - print 'Cannot run gnunet-qr, please install zbar-python' - sys.exit (1) + print 'Cannot run gnunet-qr, please install zbar-python' + sys.exit (1) def help (): print 'gnunet-qr\n\ @@ -36,7 +36,6 @@ if __name__ == '__main__': help () print str (e) exit (1) - print "asdsa" for o,a in opts: if o in ("-h", "--help"): help () @@ -49,7 +48,7 @@ if __name__ == '__main__': silent = True elif o in ("-v", "--verbose"): verbose = True - id (True == verbose): + if (True == verbose): print 'Initializing' # create a Processor proc = zbar.Processor() @@ -59,7 +58,7 @@ if __name__ == '__main__': # initialize the Processor try: - id (True == verbose): + if (True == verbose): print 'Opening video device ' + device proc.init(device) except Exception as e: @@ -75,7 +74,7 @@ if __name__ == '__main__': proc.visible = True # read at least one barcode (or until window closed) try: - id (True == verbose): + if (True == verbose): print 'Capturing' proc.process_one() except Exception as e: @@ -99,9 +98,11 @@ if __name__ == '__main__': for a in args: cmd += " " + str(a) if (verbose): - print 'Running ' + cmd + print 'Running `' + cmd +'`' res=subprocess.call(args) if (0 != res): - print 'Failed to ' + print 'Failed to add URI ' + str(symbol.data) + else: + print 'Added URI ' + str(symbol.data) exit (res) exit (1)