mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Reformatting.
This commit is contained in:
parent
530f317a37
commit
f2d57fcb23
3 changed files with 4 additions and 9 deletions
|
|
@ -20,8 +20,7 @@ from wrolpi.downloader import Downloader, Download, DOWNLOAD_MANAGER_CONFIG, Dow
|
|||
from wrolpi.errors import UnknownChannel, ChannelURLEmpty, UnrecoverableDownloadError
|
||||
from wrolpi.vars import PYTEST
|
||||
from .channel.lib import create_channel, get_channel
|
||||
from .common import apply_info_json, get_no_channel_directory, \
|
||||
get_videos_directory
|
||||
from .common import apply_info_json, get_no_channel_directory, get_videos_directory
|
||||
from .lib import upsert_video, refresh_channel_videos, get_downloader_config, get_channel_source_id
|
||||
from .models import Video, Channel
|
||||
from .schema import ChannelPostRequest
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ VIDEO_DOWNLOADER_CONFIG: VideoDownloaderConfig = VideoDownloaderConfig(global_=T
|
|||
TEST_VIDEO_DOWNLOADER_CONFIG: VideoDownloaderConfig = None
|
||||
|
||||
|
||||
def get_downloader_config():
|
||||
def get_downloader_config() -> VideoDownloaderConfig:
|
||||
global TEST_VIDEO_DOWNLOADER_CONFIG
|
||||
if isinstance(TEST_VIDEO_DOWNLOADER_CONFIG, VideoDownloaderConfig):
|
||||
return TEST_VIDEO_DOWNLOADER_CONFIG
|
||||
|
|
|
|||
|
|
@ -240,17 +240,13 @@ class ConfigFile:
|
|||
return CONFIG_DIR / self.file_name
|
||||
|
||||
def update(self, config: dict):
|
||||
"""
|
||||
Update any values of this config. Save the config to its file.
|
||||
"""
|
||||
"""Update any values of this config. Save the config to its file."""
|
||||
config = {k: v for k, v in config.items() if k in self._config}
|
||||
self._config.update(config)
|
||||
self.save()
|
||||
|
||||
def dict(self):
|
||||
"""
|
||||
Get a deepcopy of this config.
|
||||
"""
|
||||
"""Get a deepcopy of this config."""
|
||||
if not hasattr(self, '_config'):
|
||||
raise NotImplementedError('You cannot use a global config while testing!')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue