added .module to import and defined contains
This commit is contained in:
parent
f80ec9cf66
commit
a605b6675e
|
|
@ -1,7 +1,7 @@
|
|||
# Interprets config files
|
||||
import os
|
||||
import yaml
|
||||
from bootstraparse import error_mngr
|
||||
from bootstraparse.modules import error_mngr
|
||||
|
||||
|
||||
class ConfigLoader:
|
||||
|
|
@ -87,9 +87,15 @@ class ConfigLoader:
|
|||
"""
|
||||
try:
|
||||
return self.loaded_conf[item]
|
||||
except KeyError:
|
||||
except KeyError: # make sure getitem is never used
|
||||
error_mngr.log_exception(KeyError(f"Error: {item} is not in {self.loaded_conf}"), level='CRITICAL')
|
||||
|
||||
def __contains__(self, item):
|
||||
"""
|
||||
Same as a dictionary.
|
||||
"""
|
||||
return item in self.loaded_conf
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
Returns config as string
|
||||
|
|
|
|||
Loading…
Reference in New Issue