From 1c01e981e0dc03cd8583788decefacc5b8f08e9a Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Thu, 5 Aug 2021 16:13:50 +0200 Subject: [PATCH] usys: Clean up. Add requirements, drop autodoc, and add a few cross references. --- doc/main/micropython/usys.rst | 21 ++++++++++++++++++--- src/usys/__init__.py | 10 +++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/doc/main/micropython/usys.rst b/doc/main/micropython/usys.rst index bf69860..e14f9bb 100644 --- a/doc/main/micropython/usys.rst +++ b/doc/main/micropython/usys.rst @@ -1,4 +1,19 @@ -:mod:`usys` -- System specific functions -======================================== +.. pybricks-requirements:: stm32-extra -.. automodule:: usys +:mod:`usys` -- System specific functions +============================================================ + +This MicroPython module is a subset of the `sys module`_ in Python. + +.. module:: usys + +.. autodata:: usys.stdin + :annotation: + +.. autodata:: usys.stdout + :annotation: + +.. autodata:: usys.stderr + :annotation: + +.. _sys module: https://docs.python.org/3.5/library/sys.html diff --git a/src/usys/__init__.py b/src/usys/__init__.py index f400afc..8ce6aa6 100644 --- a/src/usys/__init__.py +++ b/src/usys/__init__.py @@ -7,17 +7,16 @@ """ This module provides a subset of the standard Python ``sys`` module. - -.. note:: This module is not available on the BOOST Move hub. """ from uio import FileIO -# REVIST: most functions are excluded since they aren't useful for Pybricks +# REVISIT: most functions are excluded since they aren't useful for Pybricks stdin: FileIO = FileIO() """ -Stream object that receives input from a connected terminal, if any. +Stream object (:class:`uio.FileIO`) that receives input from a connected +terminal, if any. Writing may modify newline characters. Use ``usys.stdin.buffer`` instead if this is undesirable. @@ -28,7 +27,8 @@ are passing binary data via ``stdin``. stdout: FileIO = FileIO() """ -Stream object that sends output to a connected terminal, if any. +Stream object (:class:`uio.FileIO`) that sends output to a connected terminal, +if any. Reading may modify newline characters. Use ``usys.stdout.buffer`` instead if this is undesirable.