mirror of
https://github.com/clearml/wexpect-venv
synced 2025-06-26 18:15:52 +00:00
[ADD] First draft of autodoc
This commit is contained in:
parent
f91da266e6
commit
3ca381f701
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
[](https://ci.appveyor.com/project/raczben/wexpect)
|
[](https://ci.appveyor.com/project/raczben/wexpect)
|
||||||
[](https://codecov.io/gh/raczben/wexpect)
|
[](https://codecov.io/gh/raczben/wexpect)
|
||||||
|
[](https://wexpect.readthedocs.io/en/latest/?badge=latest)
|
||||||
|
|
||||||
*Wexpect* is a Windows variant of [pexpect](https://pexpect.readthedocs.io/en/stable/).
|
*Wexpect* is a Windows variant of [pexpect](https://pexpect.readthedocs.io/en/stable/).
|
||||||
|
|
||||||
@ -18,13 +19,6 @@ them automatically.
|
|||||||
|
|
||||||
pip install wexpect
|
pip install wexpect
|
||||||
|
|
||||||
OR
|
|
||||||
|
|
||||||
Because wexpect a tiny project dropping the wexpect.py file into your working directory is usually
|
|
||||||
good enough instead of installing. However in this case you need to install manually the pypiwin32
|
|
||||||
dependence.
|
|
||||||
|
|
||||||
|
|
||||||
## **Usage**
|
## **Usage**
|
||||||
|
|
||||||
To interract with a child process use `spawn` method:
|
To interract with a child process use `spawn` method:
|
||||||
|
1
doc/requirements.txt
Normal file
1
doc/requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
pbr
|
7
doc/source/api/index.rst
Normal file
7
doc/source/api/index.rst
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
API documentation
|
||||||
|
=================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
spawn_classes
|
23
doc/source/api/spawn_classes.rst
Normal file
23
doc/source/api/spawn_classes.rst
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Spawn classes
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. automodule:: wexpect.host
|
||||||
|
|
||||||
|
SpawnPipe
|
||||||
|
---------
|
||||||
|
|
||||||
|
.. autoclass:: SpawnPipe
|
||||||
|
|
||||||
|
.. automethod:: __init__
|
||||||
|
.. automethod:: expect
|
||||||
|
.. automethod:: expect_exact
|
||||||
|
.. automethod:: expect_list
|
||||||
|
.. automethod:: compile_pattern_list
|
||||||
|
.. automethod:: send
|
||||||
|
.. automethod:: sendline
|
||||||
|
.. automethod:: write
|
||||||
|
.. automethod:: writelines
|
||||||
|
.. automethod:: sendeof
|
||||||
|
.. automethod:: read
|
||||||
|
.. automethod:: readline
|
||||||
|
.. automethod:: read_nonblocking
|
@ -9,10 +9,23 @@
|
|||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
#
|
|
||||||
# import os
|
import os
|
||||||
# import sys
|
import sys
|
||||||
# sys.path.insert(0, os.path.abspath('.'))
|
from pbr.version import VersionInfo
|
||||||
|
|
||||||
|
repo_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
|
||||||
|
print(repo_path)
|
||||||
|
sys.path.insert(0, repo_path)
|
||||||
|
|
||||||
|
# import wexpect
|
||||||
|
|
||||||
|
os.environ['WEXPECT_SPAWN_CLASS'] = 'SpawnPipe'
|
||||||
|
autodoc_mock_imports = ["pywintypes", "win32process", "win32con", "win32file", "winerror",
|
||||||
|
"win32pipe", "ctypes", "win32console", "win32gui"]
|
||||||
|
|
||||||
|
# from ctypes import windll
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
@ -21,8 +34,18 @@ project = 'wexpect'
|
|||||||
copyright = '2020, Benedek Racz'
|
copyright = '2020, Benedek Racz'
|
||||||
author = 'Benedek Racz'
|
author = 'Benedek Racz'
|
||||||
|
|
||||||
# The full version, including alpha/beta/rc tags
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
release = '0.0.1'
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
# built documents.
|
||||||
|
#
|
||||||
|
# The short X.Y version.
|
||||||
|
package_name='wexpect'
|
||||||
|
info = VersionInfo(package_name)
|
||||||
|
version = info.version_string()
|
||||||
|
|
||||||
|
# The full version, including alpha/beta/rc tags.
|
||||||
|
release = version
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
@ -30,7 +53,7 @@ release = '0.0.1'
|
|||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [ 'sphinx.ext.autodoc'
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
@ -52,4 +75,4 @@ html_theme = 'alabaster'
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# 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,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
9
doc/source/history.rst
Normal file
9
doc/source/history.rst
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
History
|
||||||
|
=======
|
||||||
|
|
||||||
|
Wexpect was a one-file code developed at University of Washington. There were several
|
||||||
|
`copy <https://gist.github.com/anthonyeden/8488763>`_ and
|
||||||
|
`reference <https://mediarealm.com.au/articles/python-pexpect-windows-wexpect/>`_
|
||||||
|
to this code with very few (almost none) documentation nor integration.
|
||||||
|
|
||||||
|
This project fixes these limitations, with example codes and pypi integration.
|
@ -6,6 +6,11 @@ Wexpect version |version|
|
|||||||
:align: right
|
:align: right
|
||||||
:alt: Build status
|
:alt: Build status
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
**UNDER CONSTRUCTION!!!**
|
||||||
|
Documentation is in a very preliminary state. I'm learning sphinx and
|
||||||
|
readthedocs.
|
||||||
|
|
||||||
*Wexpect* is a Windows variant of `Pexpect <https://pexpect.readthedocs.io/en/stable/>`_
|
*Wexpect* is a Windows variant of `Pexpect <https://pexpect.readthedocs.io/en/stable/>`_
|
||||||
Wexpect and Pexpect makes Python a better tool for controlling other applications.
|
Wexpect and Pexpect makes Python a better tool for controlling other applications.
|
||||||
|
|
||||||
@ -29,8 +34,8 @@ Wexpect is on PyPI, and can be installed with standard tools::
|
|||||||
|
|
||||||
pip install wexpect
|
pip install wexpect
|
||||||
|
|
||||||
Usage
|
Hello Wexpect
|
||||||
^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
To interract with a child process use :code:`spawn` method:
|
To interract with a child process use :code:`spawn` method:
|
||||||
|
|
||||||
@ -49,15 +54,12 @@ For more information see [examples](./examples) folder.
|
|||||||
|
|
||||||
|
|
||||||
Contents:
|
Contents:
|
||||||
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
overview
|
|
||||||
api/index
|
api/index
|
||||||
examples
|
|
||||||
FAQ
|
|
||||||
commonissues
|
|
||||||
history
|
history
|
||||||
|
|
||||||
Wexpect is developed `on Github <http://github.com/raczben/wexpect>`_. Please
|
Wexpect is developed `on Github <http://github.com/raczben/wexpect>`_. Please
|
||||||
|
Loading…
Reference in New Issue
Block a user