diff --git a/.travis.yml b/.travis.yml index 39b238e..e027551 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ addons: apt: packages: - graphviz + - libenchant1c2a env: global: - ESCPOS_CAPABILITIES_FILE=/home/travis/build/python-escpos/python-escpos/capabilities-data/dist/capabilities.json @@ -19,7 +20,7 @@ matrix: language: shell before_install: - choco install python - - pip install tox codecov 'sphinx>=1.5.1' + - pip install tox codecov 'sphinx>=1.5.1' 'sphinxcontrib-spelling>=5' env: - TOXENV=py37 - PATH=/c/Python37:/c/Python37/Scripts:$PATH @@ -57,7 +58,7 @@ matrix: - os: windows - os: osx before_install: - - pip install tox codecov 'sphinx>=1.5.1' + - pip install tox codecov 'sphinx>=1.5.1' 'sphinxcontrib-spelling>=5' - ./doc/generate_authors.sh --check script: - tox diff --git a/doc/Makefile b/doc/Makefile index f423c2f..535ebbd 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -19,7 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext spelling help: @echo "Please use \`make ' where is one of" @@ -45,6 +45,7 @@ help: @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " spelling to run the spellchecker" clean: rm -rf $(BUILDDIR)/* @@ -175,3 +176,8 @@ pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +spelling: + $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling + @echo + @echo "Spellchecker finished." diff --git a/doc/conf.py b/doc/conf.py index 2cbe0cf..db40f67 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -43,6 +43,7 @@ extensions = [ 'sphinx.ext.todo', 'sphinx.ext.graphviz', 'sphinx.ext.inheritance_diagram', + 'sphinxcontrib.spelling', ] # supress warnings for external images @@ -292,3 +293,9 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False + +# spellchecker +spelling_ignore_pypi_package_names = True +spelling_ignore_wiki_words = True +spelling_ignore_python_builtins = True +spelling_ignore_importable_modules = True diff --git a/doc/requirements.txt b/doc/requirements.txt index 0908f3d..728e22d 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,4 +6,5 @@ sphinx-rtd-theme setuptools setuptools-scm docutils>=0.12 +sphinxcontrib-spelling>=5 python-barcode>=0.11.0,<1 diff --git a/doc/spelling_wordlist.txt b/doc/spelling_wordlist.txt new file mode 100644 index 0000000..e037ead --- /dev/null +++ b/doc/spelling_wordlist.txt @@ -0,0 +1,7 @@ +Raspbian +ESC +POS +Escpos +Escpos +baudrate +lsusb \ No newline at end of file diff --git a/doc/user/usage.rst b/doc/user/usage.rst index 21537a8..947a521 100644 --- a/doc/user/usage.rst +++ b/doc/user/usage.rst @@ -48,9 +48,9 @@ to have and the second yields the "Output Endpoint" address. By default the "Interface" number is "0" and the "Output Endpoint" address is "0x01". If you have other values then you can define them on -your instance. So, assuming that we have another printer, CT-S2000, -manufactured by Citizen (with "Vendor ID" of 2730 and "Product ID" of 0fff) -where in\_ep is on 0x81 and out\_ep=0x02, then the printer definition should +your instance. So, assuming that we have another printer, CT-S2000, +manufactured by Citizen (with "Vendor ID" of 2730 and "Product ID" of 0fff) +where in\_ep is on 0x81 and out\_ep=0x02, then the printer definition should look like: **Generic USB Printer initialization** @@ -163,7 +163,7 @@ The printer section The ``printer`` configuration section defines a default printer to create. -The only required paramter is ``type``. The value of this has to be one of the +The only required parameter is ``type``. The value of this has to be one of the printers defined in :doc:`/user/printers`. The rest of the given parameters will be passed on to the initialization of the printer class. @@ -199,7 +199,7 @@ Python-escpos is designed to accept unicode. For normal usage you can simply pass your text to the printers ``text()``-function. It will automatically guess the right codepage and then send the encoded data to the printer. If this feature does not work, please try to -isolate the error and then create an issue on the Github project page. +isolate the error and then create an issue on the GitHub project page. If you want or need to you can manually set the codepage. For this please use the ``charcode()``-function. You can set any key-value that is in ``CHARCODE``. If something is wrong, an ``CharCodeError`` will be raised. diff --git a/setup.cfg b/setup.cfg index 6d6ff7f..8052855 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,6 +60,7 @@ tests_require = mock hypothesis>4 flake8 + sphinxcontrib-spelling>=5 [nosetests] verbosity=3 diff --git a/src/escpos/capabilities.py b/src/escpos/capabilities.py index 2c9c909..80f88a1 100644 --- a/src/escpos/capabilities.py +++ b/src/escpos/capabilities.py @@ -59,7 +59,7 @@ BARCODE_B = 'barcodeB' class BaseProfile(object): - """This respresents a printer profile. + """This represents a printer profile. A printer profile knows about the number of columns, supported features, colors and more. diff --git a/src/escpos/cli.py b/src/escpos/cli.py index 1b0db9e..c9f9125 100644 --- a/src/escpos/cli.py +++ b/src/escpos/cli.py @@ -3,7 +3,7 @@ """ CLI This module acts as a command line interface for python-escpos. It mirrors -closely the available ESCPOS commands while adding a couple extra ones for convience. +closely the available ESCPOS commands while adding a couple extra ones for convenience. It requires you to have a configuration file. See documentation for details. @@ -554,7 +554,7 @@ def main(): def demo(printer, **kwargs): """ - Prints specificed demos. Called when CLI is passed `demo`. This function + Prints demos. Called when CLI is passed `demo`. This function uses the DEMO_FUNCTIONS dictionary. :param printer: A printer from escpos.printer diff --git a/src/escpos/config.py b/src/escpos/config.py index e2dd789..b4cdb33 100644 --- a/src/escpos/config.py +++ b/src/escpos/config.py @@ -1,6 +1,6 @@ """ ESC/POS configuration manager. -This module contains the implentations of abstract base class :py:class:`Config`. +This module contains the implementations of abstract base class :py:class:`Config`. """ diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index 24f6475..05a763d 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -398,7 +398,7 @@ class Escpos(object): *default*: A :param check: If this parameter is True, the barcode format will be checked to ensure it meets the bc - requirements as defigned in the esc/pos documentation. See :py:meth:`.check_barcode()` + requirements as definged in the ESC/POS documentation. See :py:meth:`.check_barcode()` for more information. *default*: True. :raises: :py:exc:`~escpos.exceptions.BarcodeSizeError`, diff --git a/test/test_abstract_base_class.py b/test/test_abstract_base_class.py index cc09ee1..5edc8a2 100644 --- a/test/test_abstract_base_class.py +++ b/test/test_abstract_base_class.py @@ -1,5 +1,5 @@ #!/usr/bin/python -"""verifies that the metaclass abc is properly used by Escpos +"""verifies that the metaclass abc is properly used by ESC/POS :author: `Patrick Kanzler `_ :organization: `python-escpos `_ @@ -16,7 +16,7 @@ from abc import ABCMeta @raises(TypeError) def test_abstract_base_class_raises(): - """test whether the abstract base class raises an exception for Escpos""" + """test whether the abstract base class raises an exception for ESC/POS""" escpos.Escpos() # This call should raise TypeError because of abstractmethod _raw() diff --git a/tox.ini b/tox.ini index d0f9361..1501eb8 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,6 @@ deps = nose pytest-mock hypothesis>4 python-barcode - viivakoodi commands = pytest --cov escpos passenv = ESCPOS_CAPABILITIES_PICKLE_DIR ESCPOS_CAPABILITIES_FILE CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_* @@ -29,6 +28,7 @@ changedir = doc deps = sphinx>=1.5.1 setuptools_scm python-barcode + sphinxcontrib-spelling>=5 commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html [testenv:flake8]