|
|
@ -48,15 +48,12 @@ def parse(keyword, config, argument, contentlist): |
|
|
|
filepath = load_from_datadirs(path, config) |
|
|
|
content_file = None |
|
|
|
try: |
|
|
|
content_file = encoding.open_read(filepath, 'r') |
|
|
|
with encoding.open_read(filepath, 'r') as content_file: |
|
|
|
new_content = json.load(content_file) |
|
|
|
except Exception as error: # pylint: disable=broad-except |
|
|
|
LOGGER.error(error) |
|
|
|
LOGGER.error("Error while loading file '{}'.".format(filepath)) |
|
|
|
sys.exit(1) |
|
|
|
finally: |
|
|
|
if content_file: |
|
|
|
content_file.close() |
|
|
|
|
|
|
|
config["datadir"].append(os.path.abspath(os.path.dirname(filepath))) |
|
|
|
new_contentlist += process_content(new_content, config) |
|
|
|