From cc61032bec570fb37c5eabcdf89343ed0b5d693e Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 16 Jul 2019 22:38:42 +0200 Subject: [PATCH] Fixes for readthedocs build --- docs/source/conf.py | 1 + platypush/backend/http/request/rss/__init__.py | 2 +- platypush/plugins/camera/__init__.py | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 34e63709..a1dca25b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -219,6 +219,7 @@ autodoc_mock_imports = ['googlesamples.assistant.grpc.audio_helpers', 'mpd', 'serial', 'pyHS100', + 'grpc', ] sys.path.insert(0, os.path.abspath('../..')) diff --git a/platypush/backend/http/request/rss/__init__.py b/platypush/backend/http/request/rss/__init__.py index e088614a..c7747034 100644 --- a/platypush/backend/http/request/rss/__init__.py +++ b/platypush/backend/http/request/rss/__init__.py @@ -23,12 +23,12 @@ Session = scoped_session(sessionmaker()) class RssUpdates(HttpRequest): """ Gets new items in an RSS feed """ - workdir = os.path.join(os.path.expanduser(Config.get('workdir')), 'feeds') dbfile = os.path.join(workdir, 'rss.db') user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36' def __init__(self, url, title=None, headers=None, params=None, max_entries=None, mercury_api_key=None, digest_format=None, *argv, **kwargs): + self.workdir = os.path.join(os.path.expanduser(Config.get('workdir')), 'feeds') self.url = url self.title = title self.max_entries = max_entries diff --git a/platypush/plugins/camera/__init__.py b/platypush/plugins/camera/__init__.py index bdd5f140..22970ab6 100644 --- a/platypush/plugins/camera/__init__.py +++ b/platypush/plugins/camera/__init__.py @@ -40,11 +40,12 @@ class CameraPlugin(Plugin): _default_warmup_frames = 5 _default_sleep_between_frames = 0 _default_color_transform = 'COLOR_BGR2BGRA' + _default_frames_dir = None _max_stored_frames = 100 _frame_filename_regex = re.compile('(\d+)-(\d+)-(\d+)_(\d+)-(\d+)-(\d+)-(\d+).jpe?g$') - def __init__(self, device_id=0, frames_dir=_default_frames_dir, + def __init__(self, device_id=0, frames_dir=None, warmup_frames=_default_warmup_frames, video_type=0, sleep_between_frames=_default_sleep_between_frames, max_stored_frames=_max_stored_frames, @@ -113,11 +114,9 @@ class CameraPlugin(Plugin): super().__init__(**kwargs) - self._default_frames_dir = os.path.join(Config.get('workdir'), 'camera', - 'frames') - + self._default_frames_dir = os.path.join(Config.get('workdir'), 'camera', 'frames') self.default_device_id = device_id - self.frames_dir = os.path.abspath(os.path.expanduser(frames_dir)) + self.frames_dir = os.path.abspath(os.path.expanduser(frames_dir or _default_frames_dir)) self.warmup_frames = warmup_frames self.video_type = cv2.VideoWriter_fourcc(*video_type) \ if isinstance(video_type, str) else video_type