From a966e22115f75cf79d4dde06d041523fcc4a2abb Mon Sep 17 00:00:00 2001
From: Rahix <rahix@rahix.de>
Date: Wed, 21 Aug 2019 16:26:52 +0200
Subject: [PATCH] chore(docs): Fix python-directives with double-module

Signed-off-by: Rahix <rahix@rahix.de>
---
 Documentation/pycardium/buttons.rst        | 12 +++++-----
 Documentation/pycardium/gpio.rst           | 27 ++++++++++++----------
 Documentation/pycardium/light-sensor.rst   |  6 ++---
 Documentation/pycardium/os.rst             | 10 ++++----
 Documentation/pycardium/personal_state.rst | 22 +++++++++---------
 Documentation/pycardium/stdlib.rst         |  4 ++--
 6 files changed, 42 insertions(+), 39 deletions(-)

diff --git a/Documentation/pycardium/buttons.rst b/Documentation/pycardium/buttons.rst
index 6a734c4e..1119f700 100644
--- a/Documentation/pycardium/buttons.rst
+++ b/Documentation/pycardium/buttons.rst
@@ -27,7 +27,7 @@ in your scripts.
    if pressed & buttons.BOTTOM_RIGHT != 0:
       print("Right button pressed!")
 
-.. py:function:: buttons.read(mask)
+.. py:function:: read(mask)
 
    Read button status.
 
@@ -38,22 +38,22 @@ in your scripts.
    :returns: An integer with the bits for pressed buttons set.  Use the same
       costants as for the mask to check which buttons were pressed.
 
-.. py:data:: buttons.BOTTOM_LEFT
+.. py:data:: BOTTOM_LEFT
 
    Bottom left button.
 
-.. py:data:: buttons.BOTTOM_RIGHT
+.. py:data:: BOTTOM_RIGHT
 
    Bottom right button.
 
-.. py:data:: buttons.TOP_RIGHT
+.. py:data:: TOP_RIGHT
 
    Top right button.
 
-.. py:data:: buttons.TOP_LEFT
+.. py:data:: TOP_LEFT
 
    Top left button (Reset button).
 
-.. py:data:: buttons.RESET
+.. py:data:: RESET
 
    Top left button (Reset button).
diff --git a/Documentation/pycardium/gpio.rst b/Documentation/pycardium/gpio.rst
index ce8225ca..51c7d5f9 100644
--- a/Documentation/pycardium/gpio.rst
+++ b/Documentation/pycardium/gpio.rst
@@ -18,7 +18,7 @@ output in your scripts.
    state = gpio.read(gpio.WRISTBAND_2)
    print("State of Wristband pin 2:", state)
 
-.. py:function:: gpio.set_mode(pin, mode)
+.. py:function:: set_mode(pin, mode)
 
    Configure GPIO pin state.
 
@@ -27,55 +27,58 @@ output in your scripts.
       integer by ORing :py:data:`gpio.mode.OUTPUT`, :py:data:`gpio.mode.INPUT`,
       :py:data:`gpio.mode.PULL_UP`, :py:data:`gpio.mode.PULL_DOWN`.
 
-.. py:function:: gpio.get_mode(pin)
+.. py:function:: get_mode(pin)
 
    Get GPIO pin state.
 
    :param int pin: ID of the pin of to get the mode of.
    :returns: An integer with the configure mode bits set.
 
-.. py:function:: gpio.write(pin, value)
+.. py:function:: write(pin, value)
 
    Write a value to a GPIO pin.
 
    :param int pin: ID of the pin of to get the mode of.
    :param bool value: New pin value.
 
-.. py:function:: gpio.read(pin)
+.. py:function:: read(pin)
 
    Read GPIO pin value.
 
    :param int pin: ID of the pin of to get the mode of.
    :returns: Current value of the GPIO pin.
 
-.. py:data:: gpio.WRISTBAND_1
+.. py:data:: WRISTBAND_1
 
    Pin ID for Wristband GPIO 1.
 
-.. py:data:: gpio.WRISTBAND_2
+.. py:data:: WRISTBAND_2
 
    Pin ID for Wristband GPIO 2.
 
-.. py:data:: gpio.WRISTBAND_3
+.. py:data:: WRISTBAND_3
 
    Pin ID for Wristband GPIO 3.
 
-.. py:data:: gpio.WRISTBAND_4
+.. py:data:: WRISTBAND_4
 
    Pin ID for Wristband GPIO 4.
 
-.. py:data:: gpio.mode.OUTPUT
+
+.. py:module:: gpio.mode
+
+.. py:data:: OUTPUT
 
    Configures a pin as output.
 
-.. py:data:: gpio.mode.INPUT
+.. py:data:: INPUT
 
    Configures a pin as input.
 
-.. py:data:: gpio.mode.PULL_UP
+.. py:data:: PULL_UP
 
    Enables the internal pull-up resistor of a pin.
 
-.. py:data:: gpio.mode.PULL_DOWN
+.. py:data:: PULL_DOWN
 
    Enables the internal pull-down resistor of a pin.
diff --git a/Documentation/pycardium/light-sensor.rst b/Documentation/pycardium/light-sensor.rst
index 199bb68e..6ffcb05c 100644
--- a/Documentation/pycardium/light-sensor.rst
+++ b/Documentation/pycardium/light-sensor.rst
@@ -6,12 +6,12 @@ On the harmonic board, there is an IR-LED which can be used in reverse as a
 crude brightness sensor.  Values returned are in no particular unit but seem to
 be fairly stable.
 
-.. py:function:: light_sensor.start()
+.. py:function:: start()
 
    Turn on the ADC and start reading brightness values.  (In past this function must be
    called before any measurements can be taken.)
 
-.. py:function:: light_sensor.get_reading()
+.. py:function:: get_reading()
 
    Get an ambient brightness reading.  The returned value is in no particular
    unit, though it seems to be fairly stable. The value could be between 0 and 400.  Common values:
@@ -22,6 +22,6 @@ be fairly stable.
 
    :returns: A brightness reading in no particular unit
 
-.. py:function:: light_sensor.stop()
+.. py:function:: stop()
 
    Stop the ADC.
diff --git a/Documentation/pycardium/os.rst b/Documentation/pycardium/os.rst
index c2c51ee3..8097bf7f 100644
--- a/Documentation/pycardium/os.rst
+++ b/Documentation/pycardium/os.rst
@@ -7,13 +7,13 @@ The ``os`` module allows access to a few core functionalities of Epicardium and
 CPython-Like
 ------------
 
-.. py:function:: os.unlink(path)
+.. py:function:: unlink(path)
 
    Unlink (remove) a file.
 
    :param str path: The file to remove.
 
-.. py:function:: os.listdir(dir)
+.. py:function:: listdir(dir)
 
    List contents of a directory.
 
@@ -24,7 +24,7 @@ CPython-Like
 Epicardium-Specific
 -------------------
 
-.. py:function:: os.exit(ret = None)
+.. py:function:: exit(ret = None)
 
    Exit from the current app and return to the menu.
 
@@ -33,7 +33,7 @@ Epicardium-Specific
       success).
    :return: This function will never return.
 
-.. py:function:: os.exec(name)
+.. py:function:: exec(name)
 
    Try executing a new app, stopping the currently running one.
 
@@ -44,7 +44,7 @@ Epicardium-Specific
    :param str name: Path to new app/script/l0dable.
    :return: This function never returns.  It can, however raise an exception.
 
-.. py:function:: os.reset()
+.. py:function:: reset()
 
    Reboot card10.
 
diff --git a/Documentation/pycardium/personal_state.rst b/Documentation/pycardium/personal_state.rst
index 7bf03681..62355e1a 100644
--- a/Documentation/pycardium/personal_state.rst
+++ b/Documentation/pycardium/personal_state.rst
@@ -22,42 +22,42 @@ The :py:mod:`personal_state` module allows you to set and get the card10 users p
    # Clear the currently configured state
    personal_state.clear()
 
-.. py:function:: personal_state.set(state, persistent)
+.. py:function:: set(state, persistent)
 
    Set the users personal state.
 
    :param int state: ID of the personal state to set. Must be one of :py:data:`personal_state.NO_CONTACT`, :py:data:`personal_state.CHAOS`, :py:data:`personal_state.COMMUNICATION`, :py:data:`personal_state.CAMP`.
    :param int persistent: Controls whether the personal state is persistent. A persistent state is not reset when the pycardium application is changed or restarted. In persistent mode the personal state LED is not controllable by the pycardium application.
 
-.. py:function:: personal_state.clear()
+.. py:function:: clear()
 
    Clears a previously set personal state.
-   
+
    If no personal state was set this function does nothing. It does not matter
    if a set state is marked as persistent or not.
 
-.. py:function:: personal_state.get()
+.. py:function:: get()
 
    Get the users personal state.
-   
+
    :returns: A tuple containing the currently set state and a boolean indicating if it's persistent or not.
 
-.. py:data:: personal_state.NO_STATE
+.. py:data:: NO_STATE
 
    State ID reported when no personal state is set.
 
-.. py:data:: personal_state.NO_CONTACT
+.. py:data:: NO_CONTACT
 
    State ID for the "No Contact" personal state.
 
-.. py:data:: personal_state.CHAOS
+.. py:data:: CHAOS
 
    State ID for the "Chaos" personal state.
 
-.. py:data:: personal_state.COMMUNICATION
+.. py:data:: COMMUNICATION
 
    State ID for the "Communicatoin" personal state.
-   
-.. py:data:: personal_state.CAMP
+
+.. py:data:: CAMP
 
    State ID for the "Camp" personal state.
diff --git a/Documentation/pycardium/stdlib.rst b/Documentation/pycardium/stdlib.rst
index 3f76a3bd..7a1f51c8 100644
--- a/Documentation/pycardium/stdlib.rst
+++ b/Documentation/pycardium/stdlib.rst
@@ -182,7 +182,7 @@ Struct module.
 ``uuid``
 --------
 
-.. py:class:: uuid.UUID(hex=None, bytes=None, int=None, version=None)
+.. py:class:: UUID(hex=None, bytes=None, int=None, version=None)
 
    Create a new UUID object.
 
@@ -217,7 +217,7 @@ Struct module.
 
       UUID version accordiung to RFC 4122
 
-.. py:function:: uuid.uuid4():
+.. py:function:: uuid4():
 
    Generate a new UUID version 4 (random UUID).
 
-- 
GitLab