Added check if video device is available
This commit is contained in:
@@ -11,6 +11,14 @@ from urlparse import urlparse, parse_qs
|
|||||||
def is_available():
|
def is_available():
|
||||||
if not zbar:
|
if not zbar:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
proc = zbar.Processor()
|
||||||
|
proc.init()
|
||||||
|
except zbar.SystemError:
|
||||||
|
# Cannot open video device
|
||||||
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def scan_qr():
|
def scan_qr():
|
||||||
|
|||||||
Reference in New Issue
Block a user