diff options
author | Bruno Wagner <bwgpro@gmail.com> | 2015-06-05 16:48:07 -0300 |
---|---|---|
committer | Bruno Wagner <bwgpro@gmail.com> | 2015-06-05 16:48:07 -0300 |
commit | 7f60e3eb5136444c86401bb3a1c3ae27fce668a1 (patch) | |
tree | 5f256a4f2ca77cf7771b7dbc1f22fef1d28ff0f7 /service/pixelated | |
parent | 65aa21198118105ed5772c546703d71ba9e9111e (diff) |
Refactoring the config, logging_setup is now called logger
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/application.py | 9 | ||||
-rw-r--r-- | service/pixelated/config/arguments.py (renamed from service/pixelated/config/args.py) | 0 | ||||
-rw-r--r-- | service/pixelated/config/logger.py (renamed from service/pixelated/config/logging_setup.py) | 2 | ||||
-rw-r--r-- | service/pixelated/maintenance.py | 17 |
4 files changed, 9 insertions, 19 deletions
diff --git a/service/pixelated/application.py b/service/pixelated/application.py index f36612f4..5914d51f 100644 --- a/service/pixelated/application.py +++ b/service/pixelated/application.py @@ -24,12 +24,11 @@ from twisted.internet import ssl from OpenSSL import SSL from OpenSSL import crypto -from pixelated.config import app_factory -from pixelated.config.args import parse_user_agent_args +from pixelated.config import arguments from pixelated.resources import loading_page from pixelated.config.initialize_leap import initialize_leap from pixelated.config.register import register -from pixelated.config.logging_setup import init_logging +from pixelated.config import logger, app_factory @defer.inlineCallbacks @@ -63,8 +62,8 @@ def _ssl_options(sslkey, sslcert): def initialize(): - args = parse_user_agent_args() - init_logging(debug=args.debug) + args = arguments.parse_user_agent_args() + logger.init(debug=args.debug) if args.register: register(*args.register) diff --git a/service/pixelated/config/args.py b/service/pixelated/config/arguments.py index 2c7470e2..2c7470e2 100644 --- a/service/pixelated/config/args.py +++ b/service/pixelated/config/arguments.py diff --git a/service/pixelated/config/logging_setup.py b/service/pixelated/config/logger.py index 932f746d..52f3f3a5 100644 --- a/service/pixelated/config/logging_setup.py +++ b/service/pixelated/config/logger.py @@ -19,7 +19,7 @@ import os from twisted.python import log -def init_logging(debug=False): +def init(debug=False): debug_enabled = debug or os.environ.get('DEBUG', False) logging_level = logging.DEBUG if debug_enabled else logging.INFO log_format = "%(asctime)s [%(name)s] %(levelname)s %(message)s" diff --git a/service/pixelated/maintenance.py b/service/pixelated/maintenance.py index c3e021b4..756ad435 100644 --- a/service/pixelated/maintenance.py +++ b/service/pixelated/maintenance.py @@ -15,27 +15,18 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. from mailbox import Maildir -from pixelated.config.args import parse_maintenance_args -from pixelated.config.initialize_leap import initialize_leap -from pixelated.config.logging_setup import init_logging from twisted.internet import reactor, defer from twisted.internet.threads import deferToThread +from pixelated.config.initialize_leap import initialize_leap +from pixelated.config import logger, arguments from leap.mail.imap.fields import WithMsgFields -# monkey patching some specifics -import pixelated.support.ext_protobuf -import pixelated.support.ext_sqlcipher -import pixelated.support.ext_esmtp_sender_factory -import pixelated.support.ext_fetch -import pixelated.support.ext_keymanager_fetch_key -import pixelated.support.ext_requests_urllib3 - def initialize(): - args = parse_maintenance_args() + args = arguments.parse_maintenance_args() - init_logging(debug=args.debug) + logger.init(debug=args.debug) leap_session = initialize_leap( args.leap_provider_cert, |