def _assert_valid_setting_value(self, name, value): if name == "max_key_fee": currency = str(value["currency"]).upper() if currency not in self._fixed_defaults['CURRENCIES'].keys(): raise InvalidCurrencyError(currency) elif name == "download_directory": directory = str(value) if not os.path.exists(directory): raise NoSuchDirectoryError(directory)
def _validate_currency(self, currency): if currency not in self._fixed_defaults['CURRENCIES'].keys(): raise InvalidCurrencyError(currency)