Init
This commit is contained in:
29
config.py
Normal file
29
config.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from configparser import ConfigParser
|
||||
from os.path import exists
|
||||
|
||||
cfg = ConfigParser()
|
||||
cfg['General'] = {}
|
||||
cfg['General']['FirstName'] = ''
|
||||
cfg['General']['LastName'] = ''
|
||||
cfg['General']['JobTitle'] = ''
|
||||
cfg['General']['GTSPhone'] = ''
|
||||
cfg['General']['GTSPhoneAdd'] = ''
|
||||
cfg['General']['MobilePhone'] = ''
|
||||
cfg['General']['Logo'] = 'logo.png'
|
||||
cfg['General']['Template'] = 'template.html'
|
||||
|
||||
|
||||
def save_config(cfg):
|
||||
with open('config.ini', 'w', encoding='utf-8') as configfile:
|
||||
cfg.write(configfile)
|
||||
|
||||
|
||||
def load_config():
|
||||
if not exists('config.ini'):
|
||||
with open('config.ini', 'w', encoding='utf-8') as configfile:
|
||||
cfg.write(configfile)
|
||||
else:
|
||||
cfg.read('config.ini', encoding='utf-8')
|
||||
|
||||
load_config()
|
||||
|
||||
Reference in New Issue
Block a user