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 ...@@ -12,6 +12,7 @@ import zbar, Image
# zbar (http://pypi.python.org/pypi/zbar) # zbar (http://pypi.python.org/pypi/zbar)
# Python Imaging Library (http://www.pythonware.com/products/pil/index.htm) # Python Imaging Library (http://www.pythonware.com/products/pil/index.htm)
# gstreamer python bindings (http://gstreamer.freedesktop.org/modules/gst-python.html) # gstreamer python bindings (http://gstreamer.freedesktop.org/modules/gst-python.html)
# firefox (http://www.mozilla.org/en-US/firefox/fx/#desktop)
# #
class GTK_Main: class GTK_Main:
...@@ -109,10 +110,13 @@ tee name=t ! queue ! autovideosink t. ...@@ -109,10 +110,13 @@ tee name=t ! queue ! autovideosink t.
no_qr = True no_qr = True
result = '' result = ''
for symbol in image: for symbol in image:
url = symbol.data qr = symbol.data
print(url) print(qr)
if url.find('http://fsmpi.rwth-aachen.de/lip/view/') >= 0: if qr.find('http://fsmpi.rwth-aachen.de/lip/view/') >= 0:
os.system('firefox -new-tab '+url) 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: else:
self.invalid_code() self.invalid_code()
no_qr = False 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