Fixes for readthedocs build

This commit is contained in:
Fabio Manganiello 2019-07-16 22:38:42 +02:00
parent 95b5820783
commit cc61032bec
3 changed files with 6 additions and 6 deletions

View file

@ -219,6 +219,7 @@ autodoc_mock_imports = ['googlesamples.assistant.grpc.audio_helpers',
'mpd', 'mpd',
'serial', 'serial',
'pyHS100', 'pyHS100',
'grpc',
] ]
sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('../..'))

View file

@ -23,12 +23,12 @@ Session = scoped_session(sessionmaker())
class RssUpdates(HttpRequest): class RssUpdates(HttpRequest):
""" Gets new items in an RSS feed """ """ 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') 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' 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, def __init__(self, url, title=None, headers=None, params=None, max_entries=None,
mercury_api_key=None, digest_format=None, *argv, **kwargs): 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.url = url
self.title = title self.title = title
self.max_entries = max_entries self.max_entries = max_entries

View file

@ -40,11 +40,12 @@ class CameraPlugin(Plugin):
_default_warmup_frames = 5 _default_warmup_frames = 5
_default_sleep_between_frames = 0 _default_sleep_between_frames = 0
_default_color_transform = 'COLOR_BGR2BGRA' _default_color_transform = 'COLOR_BGR2BGRA'
_default_frames_dir = None
_max_stored_frames = 100 _max_stored_frames = 100
_frame_filename_regex = re.compile('(\d+)-(\d+)-(\d+)_(\d+)-(\d+)-(\d+)-(\d+).jpe?g$') _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, warmup_frames=_default_warmup_frames, video_type=0,
sleep_between_frames=_default_sleep_between_frames, sleep_between_frames=_default_sleep_between_frames,
max_stored_frames=_max_stored_frames, max_stored_frames=_max_stored_frames,
@ -113,11 +114,9 @@ class CameraPlugin(Plugin):
super().__init__(**kwargs) super().__init__(**kwargs)
self._default_frames_dir = os.path.join(Config.get('workdir'), 'camera', self._default_frames_dir = os.path.join(Config.get('workdir'), 'camera', 'frames')
'frames')
self.default_device_id = device_id 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.warmup_frames = warmup_frames
self.video_type = cv2.VideoWriter_fourcc(*video_type) \ self.video_type = cv2.VideoWriter_fourcc(*video_type) \
if isinstance(video_type, str) else video_type if isinstance(video_type, str) else video_type