Skip to content

Commit

Permalink
add flake8-checks to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
patkan committed Jan 30, 2017
1 parent 81028f9 commit 337e8ee
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ matrix:
env: TOXENV=pypy3
- python: 2.7
env: TOXENV=docs
- python: 3.4
env: TOXENV=flake8
allow_failures:
- python: 3.5-dev
- python: nightly
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ universal=1
[flake8]
exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py
max-line-length = 120
# future-imports = absolute_import, division, print_function, unicode_literals # we are not there yet
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def run_tests(self):
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
version = '{version}'
Expand Down
3 changes: 3 additions & 0 deletions src/escpos/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ def str_to_bool(string):
"""
return string.lower() in ('y', 'yes', '1', 'true')


# A list of functions that work better with a newline to be sent after them.
REQUIRES_NEWLINE = ('qr', 'barcode', 'text', 'block_text')


# Used in demo method
# Key: The name of escpos function and the argument passed on the CLI. Some
# manual translation is done in the case of barcodes_a -> barcode.
Expand Down Expand Up @@ -568,5 +570,6 @@ def demo(printer, **kwargs):
command(**params)
printer.cut()


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions src/escpos/codepages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ def get_encoding_name(encoding):
def get_encoding(self, encoding):
return self.data[encoding]


CodePages = CodePageManager(CAPABILITIES['encodings'])
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[testenv:flake8]
basepython = python
# TODO add flake8-future
deps = flake8
commands = flake8

0 comments on commit 337e8ee

Please sign in to comment.