62 lines
757 B
Python

from configparser import ConfigParser
import os
static = """
[general]
name = CustomIcon
phone =
email =
[apps]
dhiraagu = true
ooredoo = true
hdc = true
mwsc = true
stelco = true
medianet = true
[dhiraagu]
phone =
otp =
cookie =
[ooredoo]
phone =
otp =
cookie =
[hdc]
property =
nid =
[mwsc]
meter_no =
account_no =
mobile_no =
[stelco]
account_no =
bill_no =
[medianet]
account_no =
nid =
phone =
"""
class Config(ConfigParser):
def __init__(self) -> None:
super().__init__()
if not os.path.exists('config.ini'):
self.initialize(content=static)
self.read('config.ini')
def initialize(self, content):
with open('config.ini', 'a+') as file:
file.write(content)
config = Config()