diff --git a/docs/source/backends.rst b/docs/source/backends.rst index 87769a39..820d0969 100644 --- a/docs/source/backends.rst +++ b/docs/source/backends.rst @@ -45,6 +45,7 @@ Backends platypush/backend/sensor.distance.vl53l1x.rst platypush/backend/sensor.envirophat.rst platypush/backend/sensor.ir.zeroborg.rst + platypush/backend/sensor.leap.rst platypush/backend/sensor.ltr559.rst platypush/backend/sensor.mcp3008.rst platypush/backend/sensor.motion.pwm3901.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 5aaaa375..a6710ebc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,8 +23,8 @@ import sys # -- Project information ----------------------------------------------------- project = 'platypush' -copyright = '2018, BlackLight' -author = 'BlackLight' +copyright = '2017-2019, Fabio Manganiello' +author = 'Fabio Manganiello' # The short X.Y version version = '' @@ -49,6 +49,7 @@ extensions = [ 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', + 'sphinx_rtd_theme', ] # Add any paths that contain templates here, relative to this directory. @@ -84,8 +85,8 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -# html_theme = 'alabaster' -html_theme = 'nature' +# html_theme = 'haiku' +html_theme = 'sphinx_rtd_theme' html_domain_indices = True diff --git a/docs/source/platypush/backend.rst b/docs/source/platypush/backend.rst deleted file mode 100644 index 1481f07f..00000000 --- a/docs/source/platypush/backend.rst +++ /dev/null @@ -1,6 +0,0 @@ -``platypush.backend`` -===================== - -.. automodule:: platypush.backend - :members: - diff --git a/docs/source/platypush/backend/camera.rst b/docs/source/platypush/backend/camera.rst deleted file mode 100644 index 9c2ec180..00000000 --- a/docs/source/platypush/backend/camera.rst +++ /dev/null @@ -1,6 +0,0 @@ -``platypush.backend.camera`` -============================ - -.. automodule:: platypush.backend.camera - :members: - diff --git a/docs/source/platypush/backend/http.request.rss.rst b/docs/source/platypush/backend/http.request.rss.rst deleted file mode 100644 index da97d58a..00000000 --- a/docs/source/platypush/backend/http.request.rss.rst +++ /dev/null @@ -1,6 +0,0 @@ -``platypush.backend.http.request.rss`` -====================================== - -.. automodule:: platypush.backend.http.request.rss - :members: - diff --git a/docs/source/platypush/backend/weather.forecast.rst b/docs/source/platypush/backend/weather.forecast.rst deleted file mode 100644 index 1731a1a3..00000000 --- a/docs/source/platypush/backend/weather.forecast.rst +++ /dev/null @@ -1,6 +0,0 @@ -``platypush.backend.weather.forecast`` -====================================== - -.. automodule:: platypush.backend.weather.forecast - :members: - diff --git a/docs/source/platypush/plugins/weather.forecast.rst b/docs/source/platypush/plugins/weather.forecast.rst deleted file mode 100644 index 0763f876..00000000 --- a/docs/source/platypush/plugins/weather.forecast.rst +++ /dev/null @@ -1,6 +0,0 @@ -``platypush.plugins.weather.forecast`` -====================================== - -.. automodule:: platypush.plugins.weather.forecast - :members: - diff --git a/platypush/backend/local/__init__.py b/platypush/backend/local/__init__.py index 398ab5f1..8c9186da 100644 --- a/platypush/backend/local/__init__.py +++ b/platypush/backend/local/__init__.py @@ -18,15 +18,15 @@ class LocalBackend(Backend): You can use this backend either to send local commands to push through Pusher (or any other script), or debug. You can even send command on the - command line and read the responses in this way: + command line and read the responses in this way:: - # Send the request. Remember: the JSON must be all on one line. - $ cat < /tmp/platypush-requests.fifo - {"type": "request", "target": "node_name", "action": "shell.exec", "args": {"cmd":"echo ping"}, "origin": "node_name", "id": "put_an_id_here"} - EOF - $ cat /tmp/platypush-responses.fifo - ping - $ + # Send the request. Remember: the JSON must be all on one line. + $ cat < /tmp/platypush-requests.fifo + {"type": "request", "target": "node_name", "action": "shell.exec", "args": {"cmd":"echo ping"}, "origin": "node_name", "id": "put_an_id_here"} + EOF + $ cat /tmp/platypush-responses.fifo + ping + $ """ def __init__(self, request_fifo, response_fifo, **kwargs): diff --git a/platypush/message/event/__init__.py b/platypush/message/event/__init__.py index e91f3a5c..037a9e9d 100644 --- a/platypush/message/event/__init__.py +++ b/platypush/message/event/__init__.py @@ -69,8 +69,7 @@ class Event(Message): def matches_condition(self, condition): """ If the event matches an event condition, it will return an EventMatchResult - Params: - -- condition -- The platypush.event.hook.EventCondition object + :param condition: The platypush.event.hook.EventCondition object """ result = EventMatchResult(is_match=False, parsed_args=self.args) @@ -207,12 +206,11 @@ class StopEvent(Event): def __init__(self, target, origin, thread_id, id=None, **kwargs): """ Constructor. - Params: - target -- Target node - origin -- Origin node - thread_id -- thread_iden() to be terminated if listening on the bus - id -- Event ID (default: auto-generated) - kwargs -- Extra key-value arguments + :param target: Target node + :param origin: Origin node + :param thread_id: thread_iden() to be terminated if listening on the bus + :param id: Event ID (default: auto-generated) + :param kwargs: Extra key-value arguments """ super().__init__(target=target, origin=origin, id=id, diff --git a/platypush/plugins/google/drive.py b/platypush/plugins/google/drive.py index c319f064..76736a5d 100644 --- a/platypush/plugins/google/drive.py +++ b/platypush/plugins/google/drive.py @@ -139,7 +139,7 @@ class GoogleDrivePlugin(GooglePlugin): :param path: Path of the file to upload. :param mime_type: MIME type of the source file (e.g. "``image/jpeg``"). :param name: Name of the target file. Default: same name as the source file. - :param description; File description. + :param description: File description. :param parents: List of folder IDs that will contain the file (default: drive root). :param starred: If True, then the uploaded file will be marked as starred by the user. :param target_mime_type: Target MIME type. Useful if you want to e.g. import a CSV file as a Google Sheet diff --git a/platypush/plugins/gpio/sensor/bme280.py b/platypush/plugins/gpio/sensor/bme280.py index 53276026..7411ec77 100644 --- a/platypush/plugins/gpio/sensor/bme280.py +++ b/platypush/plugins/gpio/sensor/bme280.py @@ -38,14 +38,16 @@ class GpioSensorBme280Plugin(GpioSensorPlugin): @action def get_measurement(self): """ - :returns: dict. Example:: + :returns: dict. Example: - output = { - "temperature": 21.0, # Celsius - "pressure": 101555.08, # Pascals - "humidity": 23.543, # percentage - "altitude": 15.703 # meters - } + .. code-block:: python + + output = { + "temperature": 21.0, # Celsius + "pressure": 101555.08, # Pascals + "humidity": 23.543, # percentage + "altitude": 15.703 # meters + } """ diff --git a/platypush/plugins/gpio/sensor/distance/vl53l1x.py b/platypush/plugins/gpio/sensor/distance/vl53l1x.py index 1b8759ad..c538d2bc 100644 --- a/platypush/plugins/gpio/sensor/distance/vl53l1x.py +++ b/platypush/plugins/gpio/sensor/distance/vl53l1x.py @@ -45,7 +45,9 @@ class GpioSensorDistanceVl53L1XPlugin(GpioSensorPlugin): :param medium: Enable medium range measurement (default: False) :param long: Enable long range measurement (default: False) - :returns: dict. Example:: + :returns: dict. Example: + + .. code-block:: python output = { "short": 83, # Short range measurement in mm diff --git a/platypush/plugins/gpio/sensor/envirophat.py b/platypush/plugins/gpio/sensor/envirophat.py index b4e0b5a2..fcfa2c5a 100644 --- a/platypush/plugins/gpio/sensor/envirophat.py +++ b/platypush/plugins/gpio/sensor/envirophat.py @@ -19,28 +19,30 @@ class GpioSensorEnvirophatPlugin(GpioSensorPlugin): :param: qnh: Local value for atmospheric pressure adjusted to sea level (default: 1020) :type qnh: float - :returns: dict. Example:: + :returns: dict. Example: - output = { - "temperature": 21.0, # Celsius - "pressure": 101555.08, # pascals - "altitude": 10, # meters - "luminosity": 426, # lumens + .. code-block:: python - # Measurements from the custom analog channels - "analog": [0.513, 0.519, 0.531, 0.528], + output = { + "temperature": 21.0, # Celsius + "pressure": 101555.08, # pascals + "altitude": 10, # meters + "luminosity": 426, # lumens - "accelerometer": { - "x": -0.000915, - "y": 0.0760, - "z": 1.026733 - }, - "magnetometer": { - "x": -2297, - "y": 1226, - "z": -7023 - }, - } + # Measurements from the custom analog channels + "analog": [0.513, 0.519, 0.531, 0.528], + + "accelerometer": { + "x": -0.000915, + "y": 0.0760, + "z": 1.026733 + }, + "magnetometer": { + "x": -2297, + "y": 1226, + "z": -7023 + }, + } """ diff --git a/platypush/plugins/gpio/sensor/ltr559.py b/platypush/plugins/gpio/sensor/ltr559.py index acdaf5f1..80bf8d0b 100644 --- a/platypush/plugins/gpio/sensor/ltr559.py +++ b/platypush/plugins/gpio/sensor/ltr559.py @@ -19,12 +19,14 @@ class GpioSensorLtr559Plugin(GpioSensorPlugin): @action def get_measurement(self): """ - :returns: dict. Example:: + :returns: dict. Example: - output = { - "light": 109.3543, # Lux - "proximity": 103 # The higher the value, the nearest the object, within a ~5cm range - } + .. code-block:: python +: + output = { + "light": 109.3543, # Lux + "proximity": 103 # The higher the value, the nearest the object, within a ~5cm range + } """ diff --git a/platypush/plugins/gpio/sensor/motion/pwm3901.py b/platypush/plugins/gpio/sensor/motion/pwm3901.py index 25b08f3a..dbee7b86 100644 --- a/platypush/plugins/gpio/sensor/motion/pwm3901.py +++ b/platypush/plugins/gpio/sensor/motion/pwm3901.py @@ -82,14 +82,16 @@ class GpioSensorMotionPwm3901Plugin(GpioSensorPlugin): @action def get_measurement(self): """ - :returns: dict. Example:: + :returns: dict. Example: - output = { - "motion_x": 3, # Detected motion vector X-coord - "motion_y": 4, # Detected motion vector Y-coord - "motion_mod": 5 # Detected motion vector module - "motion_events_per_sec": 7 # Number of motion events detected in the last second - } + .. code-block:: python + + output = { + "motion_x": 3, # Detected motion vector X-coord + "motion_y": 4, # Detected motion vector Y-coord + "motion_mod": 5 # Detected motion vector module + "motion_events_per_sec": 7 # Number of motion events detected in the last second + } """ diff --git a/platypush/plugins/media/__init__.py b/platypush/plugins/media/__init__.py index f6a33a97..8de8862b 100644 --- a/platypush/plugins/media/__init__.py +++ b/platypush/plugins/media/__init__.py @@ -384,7 +384,9 @@ class MediaPlugin(Plugin): the streaming link instead of streaming it :type download: bool - :returns: dict containing the streaming URL.Example:: + :return: dict containing the streaming URL.Example: + + .. code-block:: json { "id": "0123456abcdef.mp4", @@ -392,6 +394,7 @@ class MediaPlugin(Plugin): "mime_type": "video/mp4", "url": "http://192.168.1.2:8008/media/0123456abcdef.mp4" } + """ import requests diff --git a/platypush/plugins/media/ctrl.py b/platypush/plugins/media/ctrl.py index 50bf9b51..cb94e2b8 100644 --- a/platypush/plugins/media/ctrl.py +++ b/platypush/plugins/media/ctrl.py @@ -10,10 +10,12 @@ class MediaCtrlPlugin(Plugin): """ Wrapper plugin to control audio and video media. Examples of supported URL types: + - file:///media/movies/Movie.mp4 [requires media plugin enabled] - youtube:video:poAk9XgK7Cs [requires media plugin+youtube-dl] - magnet:?torrent_magnet [requires torrentcast] - spotify:track:track_id [leverages plugins.music.mpd] + """ _supported_plugins = { diff --git a/platypush/plugins/mobile/join/__init__.py b/platypush/plugins/mobile/join/__init__.py index b382b3eb..5ca5ce95 100644 --- a/platypush/plugins/mobile/join/__init__.py +++ b/platypush/plugins/mobile/join/__init__.py @@ -358,9 +358,9 @@ class MobileJoinPlugin(Plugin): displayed lower in the notification list. Values from -2 (lowest priority) to 2 (highest priority). Default is 2. :param vibration_pattern: If the notification is received on an Android device, the vibration pattern in this - field will change the way the device vibrates with it. You can easily create a pattern by going - `here `_ and generating the pattern in - the Vibration Pattern field + field will change the way the device vibrates with it. You can easily create a pattern by going to the + `AutoRemote notification page `_ + and generate the pattern in the Vibration Pattern field :type vibration_pattern: str (comma-separated float values) or list[float] :param dismiss_on_touch: If set the notification will be dismissed when touched (default: False) :param image: Publicly available URL for an image to show up in the notification @@ -368,7 +368,7 @@ class MobileJoinPlugin(Plugin): :param sound: Publicly available URL for a sound to play with the notification :param actions: Set notification buttons with customized behaviour. This parameter is a list of Join actions configured on the target device that will be mapped to notification input elements. - More info `here `_ + More info `on the Joaoapps notifications page `_ """ params = {'dismissOnTouch': dismiss_on_touch}