diff options
Diffstat (limited to 'pyapd/config.py')
-rw-r--r-- | pyapd/config.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pyapd/config.py b/pyapd/config.py index 83e35b4..fd01435 100644 --- a/pyapd/config.py +++ b/pyapd/config.py @@ -7,8 +7,7 @@ class Config(): def __init__(self, config_fn: Optional[str] = None, **kw): self.config_fn = config_fn self.data: dict = {} - if config_fn: - self.load() + self.load() def __getattr__(self, name): try: @@ -16,6 +15,12 @@ class Config(): except KeyError as e: raise NameError(e) + def __str__(self): + return "<pyapd configuration from {}>".format(self.config_fn) + + def __repr__(self): + return str(self.data) + def load(self, config_fn: Optional[str] = None): if config_fn: self.config_fn = config_fn |