Support for repository store. (#26)

* Support for repository store.

* Fix api

* part 1 of restruct and migrate pathlib

* Migrate p2

* fix lint / cleanups

* fix lint p2

* fix lint p3
This commit is contained in:
Pascal Vizeli
2017-05-02 00:02:55 +02:00
committed by GitHub
parent c76408e4e8
commit ff640c598d
14 changed files with 269 additions and 153 deletions

View File

@@ -78,7 +78,7 @@ def write_json_file(jsonfile, data):
"""Write a json file."""
try:
json_str = json.dumps(data, indent=2)
with open(jsonfile, 'w') as conf_file:
with jsonfile.open('w') as conf_file:
conf_file.write(json_str)
except (OSError, json.JSONDecodeError):
return False
@@ -88,5 +88,5 @@ def write_json_file(jsonfile, data):
def read_json_file(jsonfile):
"""Read a json file and return a dict."""
with open(jsonfile, 'r') as cfile:
with jsonfile.open('r') as cfile:
return json.loads(cfile.read())