Commit 999640e8 authored by Björn Guth's avatar Björn Guth

added crappy support for old qr codes to qr_reader.py

parent 06644edd
......@@ -12,6 +12,7 @@ import zbar, Image
# zbar (http://pypi.python.org/pypi/zbar)
# Python Imaging Library (http://www.pythonware.com/products/pil/index.htm)
# gstreamer python bindings (http://gstreamer.freedesktop.org/modules/gst-python.html)
# firefox (http://www.mozilla.org/en-US/firefox/fx/#desktop)
#
class GTK_Main:
......@@ -109,10 +110,13 @@ tee name=t ! queue ! autovideosink t.
no_qr = True
result = ''
for symbol in image:
url = symbol.data
print(url)
if url.find('http://fsmpi.rwth-aachen.de/lip/view/') >= 0:
qr = symbol.data
print(qr)
if qr.find('http://fsmpi.rwth-aachen.de/lip/view/') >= 0:
os.system('firefox -new-tab '+url)
elif qr.find('pk: ') >= 0:
pk = string.split(string.split(qr,'%')[0],': ')[1]
os.system('firefox -new-tab http://fsmpi.rwth-aachen.de/lip/view/' + pk + '+0')
else:
self.invalid_code()
no_qr = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment