aboutsummaryrefslogtreecommitdiff
path: root/pyfunkwhale/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyfunkwhale/utils.py')
-rw-r--r--pyfunkwhale/utils.py18
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))