diff options
author | neodarz <neodarz@neodarz.net> | 2020-04-11 20:50:48 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2020-04-11 20:50:48 +0200 |
commit | 246fb448132fd3ea354d235f701d9c9248a20361 (patch) | |
tree | f15890cc922b6b317b01db8641cff0274e45ca3f /pyfunkwhale/utils.py | |
parent | 47c7023dbaf5eb6682101b93f76e4c7b8acf4f56 (diff) | |
download | pyfunkwhale-246fb448132fd3ea354d235f701d9c9248a20361.tar.xz pyfunkwhale-246fb448132fd3ea354d235f701d9c9248a20361.zip |
Add more documentation
Diffstat (limited to 'pyfunkwhale/utils.py')
-rw-r--r-- | pyfunkwhale/utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pyfunkwhale/utils.py b/pyfunkwhale/utils.py index 9ba5d0f..fefb7fd 100644 --- a/pyfunkwhale/utils.py +++ b/pyfunkwhale/utils.py @@ -5,6 +5,14 @@ import json def read_file(filename): + """ + Simple wrapper for read a file content + + Parameters + ---------- + filename : str + The filename where read the datas + """ with open(filename, 'r') as file: data = file.read() @@ -12,6 +20,16 @@ def read_file(filename): def write_file(filename, data): + """ + Simple wrapper for write data in file + + Parameters + ---------- + filename : str + The filename where write the datas + data : str + The datas to write in the filename + """ with open(filename, 'w') as file: file.write(json.dumps(data)) |