From 123edfd17cd9aa38d6d5e511a8c686d5d71ab140 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 1 Jan 2018 16:55:58 +0100 Subject: made keybindings readable from an actual file --- asciifarm/common/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'asciifarm/common') diff --git a/asciifarm/common/utils.py b/asciifarm/common/utils.py index 3df020c..729c85f 100644 --- a/asciifarm/common/utils.py +++ b/asciifarm/common/utils.py @@ -32,4 +32,9 @@ def writeFileSafe(filename, data, tempname=None): with open(tempname, 'w') as f: f.write(data) os.rename(tempname, filename) - + + +def readFile(filepath): + with open(filepath, "r") as f: + text = f.read() + return text -- cgit