Small docstring fix.

This commit is contained in:
Fabio Manganiello 2023-10-20 01:41:30 +02:00
parent 0eae6fd48d
commit 8634572c34
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -5,8 +5,8 @@ from platypush.plugins import Plugin, action
class IftttPlugin(Plugin): class IftttPlugin(Plugin):
""" """
This plugin allows you to interact with the IFTTT maker API This plugin allows you to interact with the `IFTTT maker API
<https://ifttt.com/maker_webhooks> to programmatically trigger your own <https://ifttt.com/maker_webhooks>`_ to programmatically trigger your own
IFTTT hooks from Platypush - e.g. send a tweet or a Facebook post, create a IFTTT hooks from Platypush - e.g. send a tweet or a Facebook post, create a
Todoist item or a Trello task, trigger events on your mobile device, or run Todoist item or a Trello task, trigger events on your mobile device, or run
any action not natively supported by Platypush but available on your IFTTT any action not natively supported by Platypush but available on your IFTTT
@ -54,12 +54,16 @@ class IftttPlugin(Plugin):
if not values: if not values:
values = [] values = []
response = requests.post(url, json={'value{}'.format(i + 1): v response = requests.post(
for (i, v) in enumerate(values)}) url, json={'value{}'.format(i + 1): v for (i, v) in enumerate(values)}
)
if not response.ok: if not response.ok:
raise RuntimeError("IFTTT event '{}' error: {}: {}".format( raise RuntimeError(
event_name, response.status_code, response.reason)) "IFTTT event '{}' error: {}: {}".format(
event_name, response.status_code, response.reason
)
)
# vim:sw=4:ts=4:et: # vim:sw=4:ts=4:et: