diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7cf8e9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc +__pycache__/ +*.egg-info diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..fd6368a --- /dev/null +++ b/AUTHORS @@ -0,0 +1,9 @@ +List compiled from copyright headers and git commit log +------------------------------------------------------- + +Limor Fried/Ladyada +Phillip Burgess +Brendan Smithyman +Ted M Lin +Masato Mukoda +zachwick diff --git a/Adafruit_Thermal.py b/Adafruit_Thermal/Adafruit_Thermal.py similarity index 100% rename from Adafruit_Thermal.py rename to Adafruit_Thermal/Adafruit_Thermal.py diff --git a/Adafruit_Thermal/__init__.py b/Adafruit_Thermal/__init__.py new file mode 100644 index 0000000..0de09c1 --- /dev/null +++ b/Adafruit_Thermal/__init__.py @@ -0,0 +1,28 @@ +''' +Adadfruit_Thermal - a python library for interacting with TTL serial +thermal printers from Adafruit. + +Copyright 2013 2014, 2015, 2016 Adafruit Industries +See AUTHORS file for full list of contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +''' + +from .Adafruit_Thermal import * diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..0f45f9d --- /dev/null +++ b/COPYING @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2013, 2014, 2015, 2016 Adafruit Industries + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c4bf456 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include README.rst \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 7af54a6..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Python-Thermal-Printer -====================== diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..2a11591 --- /dev/null +++ b/README.rst @@ -0,0 +1,17 @@ +Python-Thermal-Printer +====================== + +Installation:: + + pip install Adafruit_Thermal + +or:: + + python setup.py install + +Usage:: + + >>> import Adafruit_Thermal + >>> printer = Adafruit_Thermal('/dev/ttyAMA0', 19200, timeout=5) + >>> printer.println('Hello World!') + diff --git a/calibrate.py b/examples/calibrate.py similarity index 100% rename from calibrate.py rename to examples/calibrate.py diff --git a/forecast.py b/examples/forecast.py similarity index 100% rename from forecast.py rename to examples/forecast.py diff --git a/gfx/__init__.py b/examples/gfx/__init__.py similarity index 100% rename from gfx/__init__.py rename to examples/gfx/__init__.py diff --git a/gfx/adalogo.py b/examples/gfx/adalogo.py similarity index 100% rename from gfx/adalogo.py rename to examples/gfx/adalogo.py diff --git a/gfx/adaqrcode.py b/examples/gfx/adaqrcode.py similarity index 100% rename from gfx/adaqrcode.py rename to examples/gfx/adaqrcode.py diff --git a/gfx/goodbye.png b/examples/gfx/goodbye.png similarity index 100% rename from gfx/goodbye.png rename to examples/gfx/goodbye.png diff --git a/gfx/hello.png b/examples/gfx/hello.png similarity index 100% rename from gfx/hello.png rename to examples/gfx/hello.png diff --git a/gfx/sudoku.png b/examples/gfx/sudoku.png similarity index 100% rename from gfx/sudoku.png rename to examples/gfx/sudoku.png diff --git a/gfx/timetemp.png b/examples/gfx/timetemp.png similarity index 100% rename from gfx/timetemp.png rename to examples/gfx/timetemp.png diff --git a/main.py b/examples/iot_printer.py similarity index 100% rename from main.py rename to examples/iot_printer.py diff --git a/printertest.py b/examples/printertest.py similarity index 100% rename from printertest.py rename to examples/printertest.py diff --git a/sudoku-gfx.py b/examples/sudoku-gfx.py similarity index 100% rename from sudoku-gfx.py rename to examples/sudoku-gfx.py diff --git a/sudoku-txt.py b/examples/sudoku-txt.py similarity index 100% rename from sudoku-txt.py rename to examples/sudoku-txt.py diff --git a/timetemp.py b/examples/timetemp.py similarity index 100% rename from timetemp.py rename to examples/timetemp.py diff --git a/twitter.py b/examples/twitter.py similarity index 100% rename from twitter.py rename to examples/twitter.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3dfd39d --- /dev/null +++ b/setup.py @@ -0,0 +1,61 @@ +''' +Adadfruit_Thermal - a python library for interacting with TTL serial +thermal printers from Adafruit. + +Copyright 2013 2014, 2015, 2016 Adafruit Industries +See AUTHORS file for full list of contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +''' + +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + +def readme(): + with open('README.rst') as f: + return f.read() + +setup(name='Adafruit_Thermal', + version='1.1.0', + description='Library for controlling Adafruit Thermal Printers', + url='https://github.com/bareo/Python-Thermal-Printer', + author='zach wick', + author_email='zwick@bareo.io', + license='MIT', + packages=['Adafruit_Thermal'], + zip_safe=False, + classifiers=[ + 'License :: OSI Approved :: MIT License', + 'Intended Audience :: Developers', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 2.7', + ], + install_requires=[ + 'pyserial', + 'Pillow', + 'unidecode', + ], + keywords='adafruit thermal printer serial', + include_package_data=True, + test_suite='nose.collector', + tests_require=['nose', 'nose-cover3'], + )