def get_port_setting(port, setting, default=None): global_setting = get_setting(setting, default) settings_port = get_setting('port') if isinstance(settings_port, int) or isinstance(settings_port, list): return global_setting return main_get_setting(settings_port.get(port, {}), setting, global_setting, check_defaults=False)
def get_setting(setting, default=None, check_defaults=True): """Fetch a setting from `client/settings.xml` `setting` is a colon-separated list of keys and to transit to fetch the desired setting. For example, `logging:handler` fetches the type Logbook handler configured on the client. `default` is the value to return if the setting does not exist. `check_defaults` indicates whether `client/default-settings.yml` should be checked if the specified setting isn't in `client/settings.xml`. Returns None if the setting does not exist. """ return main_get_setting(load_settings('client'), setting, default, check_defaults)
def get_setting(setting, default=None, check_defaults=True): return main_get_setting(load_settings('server'), setting, default, check_defaults)