diff --git a/ennstatus/api/views.py b/ennstatus/api/views.py --- a/ennstatus/api/views.py +++ b/ennstatus/api/views.py @@ -34,7 +34,7 @@ def update(): ip = request.remote_addr if request.remote_addr not in accepted_ips: - current_app.logger.warn("Unallowed IP %s tried to update data!" + current_app.logger.warn('Unallowed IP %s tried to update data!' % ip) return 'IP not allowed!\n', 403, {'Content-Type': 'text/plain'} @@ -49,7 +49,7 @@ def update(): % server['server_name']}) else: - current_app.logger.error("Unexpected error: %s" % server, + current_app.logger.error('Unexpected error: %s' % server, exc_info=True) return abort(500) diff --git a/ennstatus/donate/views.py b/ennstatus/donate/views.py --- a/ennstatus/donate/views.py +++ b/ennstatus/donate/views.py @@ -68,7 +68,7 @@ def received(): else: if 'date' in request.args: date = request.args['date'] - if request.args['date'] in choices: + if date in choices: current_app.logger.info('Showing date %s' % date) form.date.data = date csv_file = load_csv(date) diff --git a/ennstatus/log.py b/ennstatus/log.py --- a/ennstatus/log.py +++ b/ennstatus/log.py @@ -2,9 +2,9 @@ import logging import logging.handlers -logging_debug_string = ("%(levelname)s:%(name)s:%(asctime)s:%(filename)s" - ":%(lineno)d: %(message)s") -logging_string = "%(levelname)s - %(name)s - %(asctime)s - %(message)s" +logging_debug_string = ('%(levelname)s:%(name)s:%(asctime)s:%(filename)s' + ':%(lineno)d: %(message)s') +logging_string = '%(levelname)s - %(name)s - %(asctime)s - %(message)s' logging_debug_formatter = logging.Formatter(logging_debug_string) logging_formatter = logging.Formatter(logging_string) @@ -35,10 +35,10 @@ def init_logging(app): app.logger.addHandler(second_rotating_file_handler) smtp_handler = logging.handlers.SMTPHandler( - "localhost", - "info@c3l.lu", + 'localhost', + 'info@c3l.lu', app.config.get('ENNSTATUS_ADMINS', None), - "[Ennstatus] Error") + '[Ennstatus] Error') smtp_handler.setLevel(logging.ERROR) smtp_handler.setFormatter(logging_formatter) diff --git a/ennstatus/status/functions.py b/ennstatus/status/functions.py --- a/ennstatus/status/functions.py +++ b/ennstatus/status/functions.py @@ -25,7 +25,7 @@ def _check_server(data): status = None if status is not None: - current_app.logger.error("%s is set to %s" % (data['server_name'], + current_app.logger.error('%s is set to %s' % (data['server_name'], status)) for key in ('server_status', 'tor_status'): data[key] = status diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -34,18 +34,18 @@ setup(name='Ennstatus', 'templates/stats/*.html' ]}, install_requires=_get_requirements(), - classifiers=["Development Status :: 5 - Production/Stable", - "Environment :: Web Environment", - "Operating System :: POSIX", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Topic :: Internet", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", - "Topic :: Internet :: WWW/HTTP :: WSGI", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ("License :: OSI Approved :: " - "GNU General Public License v3 or later (GPLv3+)"), + classifiers=['Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Topic :: Internet', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', + 'Topic :: Internet :: WWW/HTTP :: WSGI', + 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', + ('License :: OSI Approved :: ' + 'GNU General Public License v3 or later (GPLv3+)'), ] )