From 246fb448132fd3ea354d235f701d9c9248a20361 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Apr 2020 20:50:48 +0200 Subject: Add more documentation --- pyfunkwhale/utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pyfunkwhale/utils.py') 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)) -- cgit v1.2.1