This commit is contained in:
2021-01-05 23:53:22 +08:00
commit afa2a8ea17
6 changed files with 269 additions and 0 deletions

14
readset.py Normal file
View File

@@ -0,0 +1,14 @@
class settings:
def __init__(self, fn: str=None):
if fn is not None:
self.parse(fn)
def parse(self, fn: str):
d = {}
with open(fn, 'r', encoding='utf8') as f:
t = f.read()
for i in t.splitlines(False):
l = i.split('=', 2)
if len(l) == 2:
d[l[0]] = l[1]
self._token = d['token'] if 'token' in d else None