diff --git a/core/configuration.py b/core/configuration.py index 387f9b72..2d34c8bc 100644 --- a/core/configuration.py +++ b/core/configuration.py @@ -13,17 +13,17 @@ from core import logger class Section(configobj.Section, object): - def isenabled(section): + def isenabled(self): # checks if subsection enabled, returns true/false if subsection specified otherwise returns true/false in {} - if not section.sections: + if not self.sections: try: - value = list(ConfigObj.find_key(section, 'enabled'))[0] + value = list(ConfigObj.find_key(self, 'enabled'))[0] except Exception: value = 0 if int(value) == 1: - return section + return self else: - to_return = copy.deepcopy(section) + to_return = copy.deepcopy(self) for section_name, subsections in to_return.items(): for subsection in subsections: try: @@ -40,8 +40,8 @@ class Section(configobj.Section, object): return to_return - def findsection(section, key): - to_return = copy.deepcopy(section) + def findsection(self, key): + to_return = copy.deepcopy(self) for subsection in to_return: try: value = list(ConfigObj.find_key(to_return[subsection], key))[0]