mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 02:49:43 +00:00
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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user