diff --git a/archivebox/config/__init__.py b/archivebox/config/__init__.py index 9cb6d677..0cb41563 100644 --- a/archivebox/config/__init__.py +++ b/archivebox/config/__init__.py @@ -35,6 +35,7 @@ CONFIG_DEFAULTS: Dict[str, ConfigDefaultDict] = { 'IS_TTY': {'type': bool, 'default': lambda _: sys.stdout.isatty()}, 'USE_COLOR': {'type': bool, 'default': lambda c: c['IS_TTY']}, 'SHOW_PROGRESS': {'type': bool, 'default': lambda c: c['IS_TTY']}, + # TODO: 'SHOW_HINTS': {'type: bool, 'default': True}, }, 'GENERAL_CONFIG': { diff --git a/archivebox/config/stubs.py b/archivebox/config/stubs.py index 38c7ed4c..438f7d8a 100644 --- a/archivebox/config/stubs.py +++ b/archivebox/config/stubs.py @@ -12,6 +12,20 @@ class BaseConfig(TypedDict): pass class ConfigDict(BaseConfig, total=False): + """ + # Regenerate by pasting this quine into `archivebox shell` 🥚 + from archivebox.config import ConfigDict, CONFIG_DEFAULTS + print('class ConfigDict(BaseConfig, total=False):') + print(' ' + '"'*3 + ConfigDict.__doc__ + '"'*3) + for section, configs in CONFIG_DEFAULTS.items(): + for key, attrs in configs.items(): + Type, default = attrs['type'], attrs['default'] + if default is None: + print(f' {key}: Optional[{Type.__name__}]') + else: + print(f' {key}: {Type.__name__}') + print() + """ IS_TTY: bool USE_COLOR: bool SHOW_PROGRESS: bool