projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-fix the fix
[oweals/gnunet.git]
/
src
/
util
/
gnunet-qr.py.in
diff --git
a/src/util/gnunet-qr.py.in
b/src/util/gnunet-qr.py.in
index 6f6118b28c955cb930265dc12fde535552ecfc7b..ced7a5441155a0222c8ddcaa0c3506b6ef9155f9 100755
(executable)
--- 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 sys
import getopt
import subprocess
from sys import argv
try:
- import zbar
+
import zbar
except ImportError as e:
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\
def help ():
print 'gnunet-qr\n\
@@
-36,7
+36,6
@@
if __name__ == '__main__':
help ()
print str (e)
exit (1)
help ()
print str (e)
exit (1)
- print "asdsa"
for o,a in opts:
if o in ("-h", "--help"):
help ()
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
silent = True
elif o in ("-v", "--verbose"):
verbose = True
- i
d
(True == verbose):
+ i
f
(True == verbose):
print 'Initializing'
# create a Processor
proc = zbar.Processor()
print 'Initializing'
# create a Processor
proc = zbar.Processor()
@@
-59,7
+58,7
@@
if __name__ == '__main__':
# initialize the Processor
try:
# initialize the Processor
try:
- i
d
(True == verbose):
+ i
f
(True == verbose):
print 'Opening video device ' + device
proc.init(device)
except Exception as e:
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:
proc.visible = True
# read at least one barcode (or until window closed)
try:
- i
d
(True == verbose):
+ i
f
(True == verbose):
print 'Capturing'
proc.process_one()
except Exception as e:
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):
for a in args:
cmd += " " + str(a)
if (verbose):
- print 'Running
' + cmd
+ print 'Running
`' + cmd +'`'
res=subprocess.call(args)
if (0 != res):
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)
exit (res)
exit (1)