Loading lib/bridgedb/qrcodes.py +11 −6 Changes for lib/bridgedb/qrcodes.py: 11 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,14 @@ import cStringIO import logging try: import qrcode except ImportError: qrcode = False logging.warn("Could not import Python qrcode module.") logging.debug(("You'll need the qrcode Python module for this to " "work. On Debian-based systems, this should be in the " "python-qrcode package.")) def generateQR(bridgelines, imageFormat=u'JPEG'): """Generate a QRCode for the client's bridge lines. Loading @@ -31,8 +39,10 @@ def generateQR(bridgelines, imageFormat=u'JPEG'): if not bridgelines: return if not qrcode: logging.info("Not creating QRCode for bridgelines; no qrcode module.") try: import qrcode qr = qrcode.QRCode() qr.add_data(bridgelines) Loading @@ -45,11 +55,6 @@ def generateQR(bridgelines, imageFormat=u'JPEG'): return imgstr except ImportError as error: logging.error(str(error)) logging.debug(("You'll need the qrcode Python module for this to " "work. On Debian-based systems, this should be in the " "python-qrcode package.")) except KeyError as error: logging.error(str(error)) logging.debug(("It seems python-imaging doesn't understand how to " Loading Loading
lib/bridgedb/qrcodes.py +11 −6 Changes for lib/bridgedb/qrcodes.py: 11 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,14 @@ import cStringIO import logging try: import qrcode except ImportError: qrcode = False logging.warn("Could not import Python qrcode module.") logging.debug(("You'll need the qrcode Python module for this to " "work. On Debian-based systems, this should be in the " "python-qrcode package.")) def generateQR(bridgelines, imageFormat=u'JPEG'): """Generate a QRCode for the client's bridge lines. Loading @@ -31,8 +39,10 @@ def generateQR(bridgelines, imageFormat=u'JPEG'): if not bridgelines: return if not qrcode: logging.info("Not creating QRCode for bridgelines; no qrcode module.") try: import qrcode qr = qrcode.QRCode() qr.add_data(bridgelines) Loading @@ -45,11 +55,6 @@ def generateQR(bridgelines, imageFormat=u'JPEG'): return imgstr except ImportError as error: logging.error(str(error)) logging.debug(("You'll need the qrcode Python module for this to " "work. On Debian-based systems, this should be in the " "python-qrcode package.")) except KeyError as error: logging.error(str(error)) logging.debug(("It seems python-imaging doesn't understand how to " Loading