INNER CODE UNIT · Python

has_complex_settings

ImranR98/apps.obtainium.imranr.dev · scripts/generate_from_url.py:61

def has_complex_settings(app_config):
    """Check whether a config needs to go in the complex folder."""
    settings = app_config.get("additionalSettings")
    if settings:
        try:
            if len(json.loads(settings)) > 0:
                return True
        except json.JSONDecodeError:
            return True
    return any(app_config.get(key) is not None for key in EXTRA_KEYS)


def build_config(app_config):
    """Keep only the keys that belong in a config file."""
    config = {key: app_config[key] for key in CONFIG_KEYS}
    for key in EXTRA_KEYS:
        if app_config.get(key) is not None:
            config[key] = app_config[key]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…