Changeset - ed548e9a54fa
[Not reviewed]
default
0 5 0
Dennis Fink - 11 years ago 2014-01-26 14:39:30
dennis.fink@c3l.lu
unified strings use ' instead of ", updated classifiers and use date in donations
5 files changed with 23 insertions and 23 deletions:
0 comments (0 inline, 0 general)
ennstatus/api/views.py
Show inline comments
 
@@ -31,13 +31,13 @@ def update():
 
    if 'ip' in json:
 
        ip = json['ip']
 
    else:
 
        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'}
 

	
 
    current_app.logger.info(str(json))
 
    server = update_server(server=json, ip=ip)
 

	
 
@@ -46,13 +46,13 @@ def update():
 
        current_app.logger.info(str(server))
 
        return (jsonify(server), 201,
 
                {'Location': '/api/export/json/single?server_name=%s'
 
                 % 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)
 

	
 

	
 
@api_page.route('/export', defaults={'server_type': 'all',
 
                                     'export_format': 'json'})
ennstatus/donate/views.py
Show inline comments
 
@@ -65,13 +65,13 @@ def received():
 
        if form.validate_on_submit():
 
            date = form.date.data
 
            return redirect(url_for('donate.received', date=date))
 
    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)
 
            else:
 
                current_app.logger.warn('Date %s not found' % date)
 
                return ('Date %s not found!' % date, 500,
ennstatus/log.py
Show inline comments
 
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)
 

	
 

	
 
def init_logging(app):
 

	
 
@@ -32,15 +32,15 @@ def init_logging(app):
 
            encoding='utf-8')
 
        second_rotating_file_handler.setLevel(logging.DEBUG)
 
        second_rotating_file_handler.setFormatter(logging_debug_formatter)
 
        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)
 

	
 
    app.logger.addHandler(stream_handler)
 
    app.logger.addHandler(rotating_file_handler)
ennstatus/status/functions.py
Show inline comments
 
@@ -22,13 +22,13 @@ def _check_server(data):
 
    elif delta.seconds >= 1200:
 
        status = 'Unknown'
 
    else:
 
        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
 

	
 
    filename = os.path.join('data', data['server_name'].lower()+'.json')
 

	
setup.py
Show inline comments
 
@@ -31,21 +31,21 @@ setup(name='Ennstatus',
 
                                  'templates/donate/*.html',
 
                                  'templates/root/*.html',
 
                                  'templates/status/*.html',
 
                                  '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+)'),
 
                   ]
 
      )
0 comments (0 inline, 0 general)