Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/config/__init__.py

14 lines
288 B
Python
Raw Normal View History

2020-08-12 16:01:34 +00:00
from configparser import ConfigParser
2020-08-07 17:29:44 +00:00
2020-08-12 16:01:34 +00:00
2021-02-01 15:13:11 +00:00
def config(path, q):
2020-08-07 17:29:44 +00:00
cp = ConfigParser()
2021-02-01 15:13:11 +00:00
cp.read(path)
2020-08-07 17:29:44 +00:00
section = cp.sections()[0]
2021-02-01 15:13:11 +00:00
value = cp.get(section, q)
if value.upper() == 'TRUE':
return True
if value.upper() == 'FALSE':
return False
return value