Compare commits
5 commits
15d06fa5c2
...
acb40bd5fd
Author | SHA1 | Date | |
---|---|---|---|
acb40bd5fd | |||
4f5ccda353 | |||
7bd721e6a4 | |||
c82f7bbfbe | |||
d030e2b8c7 |
4 changed files with 23 additions and 23 deletions
|
@ -49,7 +49,7 @@ steps:
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
- echo "Installing required build dependencies"
|
- echo "Installing required build dependencies"
|
||||||
- apk add --update --no-cache make py3-sphinx py3-pip py3-paho-mqtt py3-yaml
|
- apk add --update --no-cache make py3-sphinx py3-pip $(cat platypush/install/requirements/alpine.txt)
|
||||||
- pip install -U hid sphinx-rtd-theme sphinx-book-theme
|
- pip install -U hid sphinx-rtd-theme sphinx-book-theme
|
||||||
- pip install .
|
- pip install .
|
||||||
- mkdir -p /docs/current
|
- mkdir -p /docs/current
|
||||||
|
@ -76,14 +76,11 @@ steps:
|
||||||
###
|
###
|
||||||
|
|
||||||
- name: tests
|
- name: tests
|
||||||
image: python:3.11-alpine
|
image: alpine
|
||||||
commands:
|
commands:
|
||||||
- apk add --update --no-cache redis
|
- apk add --update --no-cache $(cat platypush/install/requirements/alpine.txt)
|
||||||
- apk add --update --no-cache --virtual build-base g++ rust linux-headers
|
|
||||||
- pip install -U pip
|
|
||||||
- pip install .
|
- pip install .
|
||||||
- pip install -r requirements-tests.txt
|
- pip install -r requirements-tests.txt
|
||||||
- apk del build-base g++ rust linux-headers
|
|
||||||
- pytest tests
|
- pytest tests
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
|
@ -80,7 +80,9 @@ class IntegrationEnricher:
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
if parsed_deps['pip']:
|
if parsed_deps['pip']:
|
||||||
source.insert(idx, cls._shellify('pip', 'pip ' + ' '.join(deps.pip)))
|
source.insert(
|
||||||
|
idx, cls._shellify('pip', 'pip install ' + ' '.join(deps.pip))
|
||||||
|
)
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
for pkg_manager, sys_deps in deps.by_pkg_manager.items():
|
for pkg_manager, sys_deps in deps.by_pkg_manager.items():
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import Collection
|
||||||
|
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
|
@ -20,31 +22,25 @@ class CalendarPlugin(Plugin, CalendarInterface):
|
||||||
iCal URLs) and get joined events from all of them.
|
iCal URLs) and get joined events from all of them.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, calendars=None, *args, **kwargs):
|
def __init__(self, calendars: Collection[dict], *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
:param calendars: List of calendars to be queried. Supported types so far: Google Calendar and iCal URLs.
|
:param calendars: List of calendars to be queried. Supported types so far: Google Calendar and iCal URLs.
|
||||||
:type calendars: list
|
|
||||||
|
|
||||||
Example format::
|
Example:
|
||||||
|
|
||||||
calendars = [
|
.. code-block:: yaml
|
||||||
{
|
|
||||||
"type": "platypush.plugins.google.calendar.GoogleCalendarPlugin"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
calendars:
|
||||||
"type": "platypush.plugins.calendar.ical.IcalCalendarPlugin",
|
# Use the Google Calendar integration
|
||||||
"url": "https://www.facebook.com/ical/u.php?uid=USER_ID&key=FB_KEY"
|
- type: platypush.plugins.google.calendar.GoogleCalendarPlugin
|
||||||
},
|
|
||||||
|
# Import the Facebook events calendar via iCal URL
|
||||||
|
- type: platypush.plugins.calendar.ical.IcalCalendarPlugin
|
||||||
|
url: https://www.facebook.com/ical/u.php?uid=USER_ID&key=FB_KEY
|
||||||
|
|
||||||
...
|
|
||||||
]
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
if calendars is None:
|
|
||||||
calendars = []
|
|
||||||
self.calendars = []
|
self.calendars = []
|
||||||
|
|
||||||
for calendar in calendars:
|
for calendar in calendars:
|
||||||
|
|
|
@ -99,6 +99,7 @@ class DocstringParser:
|
||||||
_param_doc_re = re.compile(r"^:param\s+(?P<name>[\w_]+):\s+(?P<doc>.*)$")
|
_param_doc_re = re.compile(r"^:param\s+(?P<name>[\w_]+):\s+(?P<doc>.*)$")
|
||||||
_type_doc_re = re.compile(r"^:type\s+[\w_]+:.*$")
|
_type_doc_re = re.compile(r"^:type\s+[\w_]+:.*$")
|
||||||
_return_doc_re = re.compile(r"^:return:\s+(?P<doc>.*)$")
|
_return_doc_re = re.compile(r"^:return:\s+(?P<doc>.*)$")
|
||||||
|
_default_docstring = re.compile(r"^Initialize self. See help")
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -164,6 +165,10 @@ class DocstringParser:
|
||||||
ctx.state = ParseState.TYPE
|
ctx.state = ParseState.TYPE
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Ignore the default constructor docstring
|
||||||
|
if cls._default_docstring.match(line):
|
||||||
|
return
|
||||||
|
|
||||||
# Update the return type docstring if required
|
# Update the return type docstring if required
|
||||||
m = cls._return_doc_re.match(line)
|
m = cls._return_doc_re.match(line)
|
||||||
if m or (ctx.state == ParseState.RETURN and cls._is_continuation_line(line)):
|
if m or (ctx.state == ParseState.RETURN and cls._is_continuation_line(line)):
|
||||||
|
|
Loading…
Reference in a new issue