mirror of
https://github.com/python-escpos/python-escpos
synced 2025-08-24 09:03:34 +00:00
drop Python 2.7 support
Python 2.7 EOL is arriving on 2020-01-01: https://pythonclock.org/ This will allow us to use Python 3 only libraries, like python-barcode, which can maintain a reduced, simpler codebase, due to only one version to support. Closes #371. Signed-off-by: Romain Porte <microjoe@microjoe.org>
This commit is contained in:
@@ -27,25 +27,6 @@ Style-Guide
|
||||
|
||||
When writing code please try to stick to these rules.
|
||||
|
||||
Python 2 and 3
|
||||
^^^^^^^^^^^^^^
|
||||
We have rewritten the code in order to maintain compatibility with both Python 2 and Python 3.
|
||||
In order to ensure that we do not miss any accidental degradation, please add these imports to the top
|
||||
of every file of code:
|
||||
|
||||
.. code-block:: Python
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
Furthermore please be aware of the differences between Python 2 and 3. For
|
||||
example `this guide <https://docs.python.org/3/howto/pyporting.html>`_ is helpful.
|
||||
Special care has to be taken when dealing with strings and byte-strings. Please note
|
||||
that the :py:meth:`~escpos.escpos.Escpos._raw`-method only accepts byte-strings.
|
||||
Often you can achieve compatibility quite easily with a tool from the `six`-package.
|
||||
|
||||
PEP8
|
||||
^^^^
|
||||
The entire codebase adheres to the rules of PEP8.
|
||||
|
Reference in New Issue
Block a user