Remove the dependency to mailustart, introducing socrate

master
kaiyou 6 years ago
parent eaa20ffbe3
commit d7747639e9

@ -1,5 +1,6 @@
import os import os
from mailustart import resolve
from socrate import system
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
# Specific to the admin UI # Specific to the admin UI
@ -72,16 +73,15 @@ class ConfigManager(dict):
'mysql': 'mysql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}' 'mysql': 'mysql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}'
} }
HOSTS = ('HOST_IMAP', 'HOST_POP3', 'HOST_AUTHSMTP', 'HOST_SMTP',
'HOST_WEBMAIL')
def __init__(self): def __init__(self):
self.config = dict() self.config = dict()
def resolve_host(self): def resolve_host(self):
self.config['HOST_IMAP'] = resolve(self.config['HOST_IMAP']) for item in self.HOSTS:
self.config['HOST_POP3'] = resolve(self.config['HOST_POP3']) self.config[item] = system.resolve_address(self.config[item])
self.config['HOST_AUTHSMTP'] = resolve(self.config['HOST_AUTHSMTP'])
self.config['HOST_SMTP'] = resolve(self.config['HOST_SMTP'])
if self.config['WEBMAIL'] != 'none':
self.config['HOST_WEBMAIL'] = resolve(self.config['HOST_WEBMAIL'])
def __coerce_value(self, value): def __coerce_value(self, value):
if isinstance(value, str) and value.lower() in ('true','yes'): if isinstance(value, str) and value.lower() in ('true','yes'):

@ -10,6 +10,7 @@ Flask-debugtoolbar
Flask-limiter Flask-limiter
redis redis
WTForms-Components WTForms-Components
socrate
passlib passlib
gunicorn gunicorn
tabulate tabulate
@ -20,3 +21,4 @@ bcrypt
tenacity tenacity
mysqlclient mysqlclient
psycopg2 psycopg2
idna

Loading…
Cancel
Save