try to make pylint happy
All checks were successful
buildbot/tox Build done.

This commit is contained in:
2022-06-08 00:08:09 +02:00
parent 8610e2a557
commit 98a6fc3ce7
60 changed files with 565 additions and 560 deletions

View File

@@ -13,7 +13,7 @@ class ModuleConfigError(Exception):
pass
class ModuleMeta(object):
class ModuleMeta:
_json_file = 'module.json'
_root_url_name = 'root'
@@ -73,7 +73,7 @@ class ModuleMeta(object):
return d
class ModuleConfig(object):
class ModuleConfig:
_lazy_load = True
def __init__(self, config_file_path=None, django_base_dir=None):
@@ -83,7 +83,7 @@ class ModuleConfig(object):
config_file_path = os.path.join(django_base_dir, DJANGO_MAIN_MODULE, MODULE_CONFIG_FILE_NAME)
self._config_file_path = config_file_path
self._modules = dict()
self._modules = {}
self._loaded = False
if not self._lazy_load:
@@ -96,13 +96,13 @@ class ModuleConfig(object):
def _load(self):
path = self._config_file_path
self._modules = dict()
self._modules = {}
if os.path.exists(path):
with open(path, 'r') as f:
with open(path, 'r', encoding='ascii') as f:
data = json.load(f)
else:
data = dict()
data = {}
if 'modules' in data:
for meta_dict in data['modules']:
@@ -131,5 +131,5 @@ class ModuleConfig(object):
for meta_obj in self._modules.values():
data['modules'].append(meta_obj.dump_as_dict())
with open(path, 'w') as f:
with open(path, 'w', encoding='ascii') as f:
json.dump(data, f, indent=4)