mirror of
https://codeberg.org/privacy1st/exec-notify
synced 2024-12-22 23:16:04 +01:00
35 lines
610 B
Python
35 lines
610 B
Python
|
from pathlib import Path
|
||
|
import configparser
|
||
|
|
||
|
|
||
|
def getHostAndPort():
|
||
|
return config['mail']['host'], config['mail']['port']
|
||
|
|
||
|
|
||
|
def getPassword():
|
||
|
return config['mail']['password']
|
||
|
|
||
|
|
||
|
def getFrom():
|
||
|
return config['mail']['from'] # used for mail login as well
|
||
|
|
||
|
|
||
|
def getTo():
|
||
|
return config['mail']['to']
|
||
|
|
||
|
|
||
|
def getErrorFile() -> Path:
|
||
|
return Path(config['file']['errorfile'])
|
||
|
|
||
|
|
||
|
def _getCfgFile() -> Path:
|
||
|
return _getCfgDir().joinpath('cfg.ini')
|
||
|
|
||
|
|
||
|
def _getCfgDir() -> Path:
|
||
|
return Path('config')
|
||
|
|
||
|
|
||
|
config: configparser.ConfigParser = configparser.ConfigParser()
|
||
|
config.read(_getCfgFile())
|