mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge branch 'dev' into enh-python3
This commit is contained in:
commit
d0b43f0e4a
2 changed files with 15 additions and 2 deletions
13
debian/changelog
vendored
13
debian/changelog
vendored
|
@ -1,3 +1,16 @@
|
||||||
|
moulinette (4.1.1) testing; urgency=low
|
||||||
|
|
||||||
|
- [enh] Add options to write_to_json ([#261](https://github.com/YunoHost/moulinette/pull/261))
|
||||||
|
- [fix] Fix tests ([#262](https://github.com/YunoHost/moulinette/pull/262))
|
||||||
|
|
||||||
|
Thanks to all contributors <3 ! (Kay0u)
|
||||||
|
|
||||||
|
-- Alexandre Aubin <alex.aubin@mailoo.org> Sat, 19 Dec 2020 01:52:06 +0100
|
||||||
|
|
||||||
|
moulinette (4.1.0.1) testing; urgency=low
|
||||||
|
|
||||||
|
- Tmp bump version number for CI / tests
|
||||||
|
|
||||||
moulinette (4.1.0) testing; urgency=low
|
moulinette (4.1.0) testing; urgency=low
|
||||||
|
|
||||||
- [enh] Simplify interface initialization (Moulinette#245)
|
- [enh] Simplify interface initialization (Moulinette#245)
|
||||||
|
|
|
@ -193,7 +193,7 @@ def append_to_file(file_path, data):
|
||||||
write_to_file(file_path, data, file_mode="a")
|
write_to_file(file_path, data, file_mode="a")
|
||||||
|
|
||||||
|
|
||||||
def write_to_json(file_path, data):
|
def write_to_json(file_path, data, sort_keys=False, indent=None):
|
||||||
"""
|
"""
|
||||||
Write a dictionnary or a list to a json file
|
Write a dictionnary or a list to a json file
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ def write_to_json(file_path, data):
|
||||||
# Write dict to file
|
# Write dict to file
|
||||||
try:
|
try:
|
||||||
with open(file_path, "w") as f:
|
with open(file_path, "w") as f:
|
||||||
json.dump(data, f)
|
json.dump(data, f, sort_keys=sort_keys, indent=indent)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
raise MoulinetteError("cannot_write_file", file=file_path, error=str(e))
|
raise MoulinetteError("cannot_write_file", file=file_path, error=str(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in a new issue