Skip to content

Commit

Permalink
docs: Sphinx documentation added for Throughput, completed for Server
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Apr 18, 2023
1 parent b9e76cb commit a1c6651
Show file tree
Hide file tree
Showing 8 changed files with 3,304 additions and 3,470 deletions.
3 changes: 2 additions & 1 deletion doc/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ Configuration of a connection
=============================
Upon construction, a :class:`Connection` object may be configured
in various ways by passing a ``config`` parameter.
in various ways by passing a ``config`` parameter. These configuration
options are valid for all RFC function module calls:
>>> conn = Connection(config = {'keyword': value, ...}, **params)
Expand Down
17 changes: 11 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os, pyrfc

# 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
Expand All @@ -26,6 +26,7 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.todo",
Expand All @@ -52,10 +53,8 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# CUSTOM: read the version from the file VERSION of the project root
version_filename = os.path.join(os.path.dirname(__file__), "..", "VERSION")
release = open(version_filename).read().strip()
version = ".".join(release.split(".")[:2])
# CUSTOM: read the version from the installed pyrfc build
release = version = pyrfc.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -121,7 +120,13 @@ def process_docstring(app, what, name, obj, options, lines):
lines.append(
u"For details see :ref:`client-connectionconfig-returnimportparams`."
)

elif name == "pyrfc.Connection.config.dtime":
lines.append(
u"If True, :meth:`~Connection.call` also returns ABAP DATE and TIME fields as Python datetime objects."
)
lines.append(
u"For details see :ref:`client-connectionconfig-dtime`."
)

def setup(app):
# Setting a hook for processing docstrings
Expand Down
83 changes: 73 additions & 10 deletions doc/pyrfc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ The :mod:`pyrfc` package.
.. toctree::
:maxdepth: 2

.. _pyrfcapi:

======================
PyRFC module functions
======================

.. autofunction:: get_nwrfclib_version
.. autofunction:: set_ini_file_directory(path_name)
.. autofunction:: reload_ini_file
.. autofunction:: language_iso_to_sap(lang_iso)
.. autofunction:: language_sap_to_iso(lang_sap)
.. autofunction:: set_cryptolib_path(path_name)
.. autofunction:: set_locale_radix(value=None)

.. _apiconn:

==========
Expand All @@ -27,24 +41,57 @@ Connection

.. autoclass:: Connection

.. autoattribute:: alive
.. autoattribute:: handle
.. autoattribute:: options
.. automethod:: get_connection_attributes()
.. automethod:: open()
.. automethod:: reopen()
.. automethod:: call(func_name, options, params)
.. automethod:: close()
.. automethod:: cancel()
.. automethod:: free()
.. automethod:: ping()
.. automethod:: reset_server_context()
.. automethod:: initialize_unit([background=True])
.. automethod:: fill_and_submit_unit(unit, calls[, queue_names=None[, attributes=None]])
.. automethod:: confirm_unit(unit)
.. automethod:: destroy_unit(unit)
.. automethod:: fill_and_submit_unit(unit, calls[, queue_names=None[, attributes=None]])
.. automethod:: get_connection_attributes()
.. automethod:: get_function_description(func_name)
.. automethod:: get_unit_state(unit)
.. automethod:: initialize_unit([background=True])
.. automethod:: ping()
.. automethod:: reset_server_context()
.. automethod:: get_function_description(func_name)
.. automethod:: type_desc_get(type_name)
.. automethod:: type_desc_remove(type_name)
.. automethod:: func_desc_remove(func_name)

.. _apiserver:

==========
Server
==========

.. autoclass:: Server

.. automethod:: bgrfc_init(sysId, bgRfcFunction)
.. automethod:: add_function(func_name, callback)
.. automethod:: serve()
.. automethod:: start()
.. automethod:: stop()
.. automethod:: close()
.. automethod:: get_server_attributes()

.. _apiconnectionparams:

=====================
Connection Parameters
=====================

.. autoclass:: ConnectionParameters

.. _apifuncdesc:

===================
FunctionDescription
===================
====================
Function Description
====================

.. note::

Expand All @@ -57,12 +104,28 @@ FunctionDescription
.. _apitypedesc:

===================
TypeDescription
Type Description
===================
.. autoclass:: TypeDescription

.. automethod:: add_field(name, field_type, nuc_length, uc_length, nuc_offset, uc_offset[, decimals=0[, type_description=None]])

.. _apithrououghput:

==========
Throughput
==========

.. autoclass:: Throughput

.. autoattribute:: _handle
.. autoattribute:: connections
.. autoattribute:: stats
.. automethod:: setOnConnection()
.. automethod:: getFromConnection()
.. automethod:: removeFromConnection()
.. automethod:: reset()

.. _apierr:

======
Expand Down
Loading

0 comments on commit a1c6651

Please sign in to comment.