60 lines
773 B
Python
Raw Normal View History

2024-04-19 16:59:43 +00:00
from configparser import ConfigParser
import os
static = """
2024-04-19 19:39:11 +00:00
2024-04-19 16:59:43 +00:00
[general]
2024-04-19 19:39:11 +00:00
name = CustomIcon
2024-04-19 16:59:43 +00:00
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]
2024-04-19 19:39:11 +00:00
meter_no =
account_no =
mobile_no =
2024-04-19 16:59:43 +00:00
[stelco]
2024-04-19 19:39:11 +00:00
account_no =
bill_no =
2024-04-19 16:59:43 +00:00
[medianet]
2024-04-19 19:39:11 +00:00
account_no =
nid =
phone =
2024-04-19 16:59:43 +00:00
"""
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()