1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

📔 Improve documentation

This commit is contained in:
Steffo 2021-04-17 17:10:28 +02:00
parent 1a4a396a66
commit 05026d525c
Signed by: steffo
GPG key ID: 6965406171929D01
5 changed files with 17 additions and 16 deletions

View file

@ -69,8 +69,7 @@ html_static_path = ['_static']
intersphinx_mapping = { intersphinx_mapping = {
"python": ("https://docs.python.org/3.8", None), "python": ("https://docs.python.org/3.8", None),
"sqlalchemy": ("https://docs.sqlalchemy.org/en/13/", None), "royalnet": ("https://royalnet-6.readthedocs.io/en/latest", None)
"async_property": ("https://async-property.readthedocs.io/en/latest/", None),
} }

View file

@ -1,14 +1,14 @@
Royalnet 6 Royalnet Console
========== ================
Welcome to the documentation of Royalnet 6! Welcome to the documentation of Royalnet Console!
Table of contents Table of contents
----------------- -----------------
.. toctree:: .. toctree::
:maxdepth: 3 :maxdepth: 2
autodoc/index autodoc/index
@ -16,7 +16,8 @@ Table of contents
Useful links Useful links
------------ ------------
* `Royalnet on GitHub <https://github.com/Steffo99/royalnet-6>`_ * `Royalnet Console on GitHub <https://github.com/Steffo99/royalnet-console>`_
* `Documentation of Royalnet <https://royalnet-6.readthedocs.io/en/latest/>`_
Indices and tables Indices and tables

View file

@ -1,5 +1,6 @@
""" """
A terminal-based implementation of the PDA class of the :mod:`royalnet.engineer` module. A terminal-based :class:`~royalnet.engineer.pda.implementations.base.PDAImplementation` of the :mod:`royalnet.engineer`
module.
""" """
from .pda import * from .pda import *

View file

@ -1,13 +1,10 @@
# Module docstring
""" """
:class:`royalnet.engineer.proj.Bullet`\\ s for the :mod:`royalnet_console` frontend. :class:`royalnet.engineer.proj.Bullet`\\ s for the :mod:`royalnet_console` frontend.
""" """
# Special imports
from __future__ import annotations from __future__ import annotations
import royalnet.royaltyping as t import royalnet.royaltyping as t
# External imports
import logging import logging
import datetime import datetime
import os import os
@ -17,7 +14,6 @@ import royalnet.engineer as engi
import click import click
import async_property as ap import async_property as ap
# Special global objects
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -26,7 +22,7 @@ async def console_message(*,
text: str = None, text: str = None,
files: t.List[t.BinaryIO] = None) -> engi.Message: files: t.List[t.BinaryIO] = None) -> engi.Message:
""" """
Output a message to the console and return the resulting proj. Output text to the console and return the corresponding :class:`~.engi.Message`.
:param text: The text of the message. :param text: The text of the message.
:param files: A :class:`list` of files to attach to the message. :param files: A :class:`list` of files to attach to the message.
@ -41,7 +37,7 @@ async def console_message(*,
log.debug("Sending message...") log.debug("Sending message...")
click.echo(text) click.echo(text)
log.debug("Creating proj...") log.debug("Creating message...")
return ConsoleMessage(_text=text) return ConsoleMessage(_text=text)
@ -123,7 +119,6 @@ class ConsoleMessageReceived(engi.MessageReceived):
return self._msg return self._msg
# Objects exported by this module
__all__ = ( __all__ = (
"ConsoleUser", "ConsoleUser",
"ConsoleChannel", "ConsoleChannel",

View file

@ -1,5 +1,5 @@
""" """
.. todo:: Document this. This module contains the :class:`.ConsolePDAImplementation`.
""" """
from __future__ import annotations from __future__ import annotations
@ -17,6 +17,11 @@ log = logging.getLogger(__name__)
class ConsolePDAImplementation(engi.ConversationListImplementation): class ConsolePDAImplementation(engi.ConversationListImplementation):
"""
A :class:`~.engi.ConversationListImplementation` which **blockingly** runs a small interactive chat in the command
line, and uses ``stdin`` e ``stdout`` to receive and send messages respectively.
"""
@property @property
def namespace(self): def namespace(self):
return "console" return "console"