pre-commit and red pill
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
from .config import config
|
||||
from .theme import Theme
|
||||
__all__ = ['config', 'Theme']
|
||||
__all__ = ['config', 'Theme']
|
||||
|
@ -5,8 +5,8 @@ static = """
|
||||
|
||||
[general]
|
||||
name = CustomIcon
|
||||
phone =
|
||||
email =
|
||||
phone =
|
||||
email =
|
||||
|
||||
[apps]
|
||||
dhiraagu = true
|
||||
@ -17,44 +17,45 @@ stelco = true
|
||||
medianet = true
|
||||
|
||||
[dhiraagu]
|
||||
phone =
|
||||
otp =
|
||||
cookie =
|
||||
phone =
|
||||
otp =
|
||||
cookie =
|
||||
|
||||
[ooredoo]
|
||||
phone =
|
||||
otp =
|
||||
cookie =
|
||||
phone =
|
||||
otp =
|
||||
cookie =
|
||||
|
||||
[hdc]
|
||||
property =
|
||||
nid =
|
||||
property =
|
||||
nid =
|
||||
|
||||
[mwsc]
|
||||
meter_no =
|
||||
account_no =
|
||||
mobile_no =
|
||||
meter_no =
|
||||
account_no =
|
||||
mobile_no =
|
||||
|
||||
[stelco]
|
||||
account_no =
|
||||
bill_no =
|
||||
account_no =
|
||||
bill_no =
|
||||
|
||||
[medianet]
|
||||
account_no =
|
||||
nid =
|
||||
phone =
|
||||
account_no =
|
||||
nid =
|
||||
phone =
|
||||
"""
|
||||
|
||||
|
||||
class Config(ConfigParser):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
if not os.path.exists("config.ini"):
|
||||
if not os.path.exists('config.ini'):
|
||||
self.initialize(content=static)
|
||||
self.read("config.ini")
|
||||
self.read('config.ini')
|
||||
|
||||
def initialize(self, content):
|
||||
with open("config.ini", 'a+') as file:
|
||||
with open('config.ini', 'a+') as file:
|
||||
file.write(content)
|
||||
|
||||
|
||||
config = Config()
|
||||
config = Config()
|
||||
|
@ -1,9 +1,10 @@
|
||||
import flet as ft
|
||||
|
||||
|
||||
class Theme:
|
||||
def __init__(self, page: ft.Page) -> None:
|
||||
self.page = page
|
||||
|
||||
|
||||
def change(self, theme: ft.ThemeMode = None):
|
||||
if theme:
|
||||
self.page.theme_mode = theme
|
||||
@ -13,4 +14,4 @@ class Theme:
|
||||
if self.page.theme_mode == ft.ThemeMode.LIGHT
|
||||
else ft.ThemeMode.LIGHT
|
||||
)
|
||||
self.page.update()
|
||||
self.page.update()
|
||||
|
Reference in New Issue
Block a user