From 0bf885baa3201edf356b402e72165d867b92bdc6 Mon Sep 17 00:00:00 2001 From: Ting-Jun Wang Date: Sat, 19 Jun 2021 21:37:21 +0800 Subject: [PATCH] feat: Add config file --- config.json.example | 7 +++++++ config.py | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 config.json.example create mode 100644 config.py diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..671d35f --- /dev/null +++ b/config.json.example @@ -0,0 +1,7 @@ +{ + "semester": "1092", + "moodle": { + "username": "學號", + "password": "密碼" + } +} \ No newline at end of file diff --git a/config.py b/config.py new file mode 100644 index 0000000..bfb6921 --- /dev/null +++ b/config.py @@ -0,0 +1,8 @@ +import json + +class CONFIG(): + @staticmethod + def get(): + with open('config.json') as fp: + data = json.load(fp) + return data \ No newline at end of file