Browse Source

config: trivial rename for better readability

master
SomberNight 3 years ago
parent
commit
dfa2b71bc3
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/simple_config.py

8
electrum/simple_config.py

@ -816,7 +816,7 @@ class SimpleConfig(Logger):
return self.decimal_point return self.decimal_point
@cached_property @cached_property
def cv(self): def cv(config):
"""Allows getting a reference to a config variable without dereferencing it. """Allows getting a reference to a config variable without dereferencing it.
Compare: Compare:
@ -826,11 +826,11 @@ class SimpleConfig(Logger):
<ConfigVarWithConfig key='server'> <ConfigVarWithConfig key='server'>
""" """
class CVLookupHelper: class CVLookupHelper:
def __getattribute__(self2, name: str) -> ConfigVarWithConfig: def __getattribute__(self, name: str) -> ConfigVarWithConfig:
config_var = self.__class__.__getattribute__(type(self), name) config_var = config.__class__.__getattribute__(type(config), name)
if not isinstance(config_var, ConfigVar): if not isinstance(config_var, ConfigVar):
raise AttributeError() raise AttributeError()
return ConfigVarWithConfig(config=self, config_var=config_var) return ConfigVarWithConfig(config=config, config_var=config_var)
def __setattr__(self, name, value): def __setattr__(self, name, value):
raise Exception( raise Exception(
f"Cannot assign value to config.cv.{name} directly. " f"Cannot assign value to config.cv.{name} directly. "

Loading…
Cancel
Save