diff --git a/doc/build/.keep b/doc/build/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/doc/source/conf.py b/doc/source/conf.py index 0a77970..e03ac20 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -124,7 +124,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/tox.ini b/tox.ini index 9d23496..2ed76c3 100644 --- a/tox.ini +++ b/tox.ini @@ -18,3 +18,9 @@ skip_missing_interpreters = true usedevelop=true deps=-rrequirements-testing.txt commands = py.test --verbose --verbose --cov xmodem {posargs} + +[testenv:build_sphinx] +# build html documentation +deps=-rrequirements-docs.txt +basepython = python3.11 +commands={envbindir}/python setup.py build_sphinx diff --git a/xmodem/__init__.py b/xmodem/__init__.py index 9dcf613..918835e 100644 --- a/xmodem/__init__.py +++ b/xmodem/__init__.py @@ -137,18 +137,20 @@ class XMODEM(object): XMODEM Protocol handler, expects two callables which encapsulate the read and write operations on the underlying stream. - Example functions for reading and writing to a serial line using `pyserial `_:: - - >>> import serial - >>> from xmodem import XMODEM - >>> ser = serial.Serial('/dev/ttyUSB0', timeout=0) # or whatever you need - >>> def getc(size, timeout=1): - ... return ser.read(size) or None - ... - >>> def putc(data, timeout=1): - ... return ser.write(data) or None - ... - >>> modem = XMODEM(getc, putc) + Example functions for reading and writing to a serial line using `pyserial `_, + + .. code-block:: python + + import serial + from xmodem import XMODEM + ser = serial.Serial('/dev/ttyUSB0', timeout=0) # or whatever you need + def getc(size, timeout=1): + return ser.read(size) or None + + def putc(data, timeout=1): + return ser.write(data) or None + + modem = XMODEM(getc, putc) :param getc: Function to retrieve bytes from a stream. The function takes the number of bytes to read from the stream and a timeout in seconds as