Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.2
* Added `qrprint` as a CLI application to print QR codes to the terminal.

# 1.2.1
* Fixed issue #43. A debug print statement got left in by mistake. I altered
The distribution script to check and make sure it does not happen again.
Expand Down
36 changes: 36 additions & 0 deletions pyqrcode/qrprint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# Released into the public domain by Teran McKinney.
"""
qrprint: CLI application for PyQRCode to print a QR code into a terminal.
"""

import argparse

import pyqrcode


def main():
"""
Where we should be called. Just a CLI application, no use using this as
a library.
"""
parser = argparse.ArgumentParser()
parser.add_argument('text', help='text for QR code')
parser.add_argument('--module_color',
help='Sets QR code data module color',
default='default')
parser.add_argument('--background',
help='Sets QR code background',
default='reverse')
parser.add_argument('--quiet_zone',
help='Sets QR code quiet zone',
default=4)
args = parser.parse_args()
qr = pyqrcode.create(args.text)
print(qr.terminal(module_color=args.module_color,
background=args.background,
quiet_zone=args.quiet_zone))
return True

if __name__ == '__main__':
main()
15 changes: 10 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the copyright holder nor the names of its
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission
#
Expand All @@ -25,7 +25,7 @@
from setuptools import setup
import sys, os.path, shutil

version = '1.2.1'
version = '1.2.2'

if sys.version_info < (2, 6, 0) and sys.version_info < (3, 0, 0):
sys.stderr.write("pyqrcode requires Python 2.6+ or 3.\n")
Expand All @@ -37,7 +37,7 @@
#source.
if os.path.exists('docs/README.rst'):
print('Reading README.rst file')
with open( 'docs/README.rst', 'r') as f:
with open('docs/README.rst', 'r') as f:
longdesc = f.read()
shutil.copyfile('docs/README.rst', 'README.rst')
else:
Expand All @@ -52,10 +52,15 @@
url='https://github.com/mnooner256/pyqrcode',
keywords=['qrcode', 'qr'],
license='BSD',
extras_require = {
extras_require={
'PNG': ["pypng>=0.0.13"],
},
classifiers = [
entry_points={
'console_scripts': [
'qrprint = pyqrcode.qrprint:main'
]
},
classifier=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
Expand Down