optimized imports, added defaults to env
This commit is contained in:
Родитель
b69566e307
Коммит
0d2cd6030f
|
@ -1,15 +1,14 @@
|
|||
import import_env_file
|
||||
import os
|
||||
from distutils.util import strtobool
|
||||
|
||||
from .core import GitHubApp
|
||||
from .ldap import LDAPClient
|
||||
|
||||
from .version import __version__
|
||||
|
||||
__all__ = ['GitHubApp', 'LDAPClient']
|
||||
|
||||
# Set default logging handler to avoid "No handler found" warnings.
|
||||
import logging
|
||||
from logging import NullHandler
|
||||
|
||||
# Set initial level to WARN. Users must manually enable logging for
|
||||
# flask_githubapp to see our logging.
|
||||
|
@ -19,4 +18,8 @@ rootlogger = logging.getLogger(__name__)
|
|||
if rootlogger.level == logging.NOTSET:
|
||||
rootlogger.setLevel(logging.WARN)
|
||||
|
||||
CRON_INTERVAL = os.environ['SYNC_SCHEDULE']
|
||||
CRON_INTERVAL = os.environ.get('SYNC_SCHEDULE', '0 * * * *')
|
||||
CHANGE_THRESHOLD = os.environ.get('CHANGE_THRESHOLD', 25)
|
||||
REPO_FOR_ISSUES = os.environ.get('REPO_FOR_ISSUES')
|
||||
ISSUE_ASSIGNEE = os.environ.get('ISSUE_ASSIGNEE')
|
||||
OPEN_ISSUE_ON_FAILURE = strtobool(os.environ.get('OPEN_ISSUE_ON_FAILURE', False))
|
Загрузка…
Ссылка в новой задаче