Changeset - 11b36dd5c030
[Not reviewed]
version_5
6 3 0
Dennis Fink - 10 years ago 2015-07-21 23:40:26
dennis.fink@c3l.lu
Remove current stats implementation as it will be replaces with d3.js
9 files changed with 0 insertions and 193 deletions:
0 comments (0 inline, 0 general)
ennstatus/__init__.py
Show inline comments
 
import os.path
 
import json
 

	
 
from flask import Flask, render_template
 
from flask.ext.bootstrap import Bootstrap
 
from flask.ext.wtf import CsrfProtect
 

	
 
from werkzeug.contrib.fixers import ProxyFix
 

	
 
import gnupg
 

	
 
bootstrap = Bootstrap()
 
csrf = CsrfProtect()
 

	
 
config_file = os.path.abspath('config.json')
 

	
 

	
 
def create_app():
 

	
 
    app = Flask(__name__)
 

	
 
    if not hasattr(app.config, 'from_json'):
 
        def from_json(file, silent=True):
 
            try:
 
                with open(file, encoding='utf-8') as json_file:
 
                    obj = json.load(json_file)
 
            except IOError:
 
                if silent:
 
                    return False
 
                raise
 

	
 
            for key in obj:
 
                if key.isupper():
 
                    app.config[key] = obj[key]
 

	
 
            return True
 

	
 
        app.config.from_json = from_json
 

	
 
    app.config.from_json(config_file)
 

	
 
    app.wsgi_app = ProxyFix(app.wsgi_app)
 

	
 
    bootstrap.init_app(app)
 
    csrf.init_app(app)
 

	
 
    from .status.functions import mail
 
    mail.init_app(app)
 

	
 
    from .root.views import root_page
 
    app.register_blueprint(root_page)
 

	
 
    from .api.views import api_page
 
    app.register_blueprint(api_page, url_prefix='/api')
 

	
 
    from .donate.views import donate_page
 
    app.register_blueprint(donate_page, url_prefix='/donate')
 

	
 
    from .status.views import status_page
 
    app.register_blueprint(status_page, url_prefix='/status')
 

	
 
    from .stats.views import stats_page
 
    app.register_blueprint(stats_page, url_prefix='/stats')
 

	
 
    from .log import init_logging
 
    init_logging(app)
 

	
 
    if 'ENNSTATUS_GPG_HOME' in app.config:
 
        gpg = gnupg.GPG(gnupghome=app.config['ENNSTATUS_GPG_HOME'])
 
        gpg.encoding = 'utf-8'
 
        app.extensions['gnupg'] = gpg
 
    else:
 
        app.extensions['gnupg'] = False
 

	
 
    @app.errorhandler(404)
 
    def page_not_found(e):
 
        return render_template('errorpages/404.html')
 

	
 
    return app
ennstatus/stats/__init__.py
Show inline comments
 
deleted file
ennstatus/stats/forms.py
Show inline comments
 
deleted file
ennstatus/stats/functions.py
Show inline comments
 
deleted file
ennstatus/stats/views.py
Show inline comments
 
deleted file
ennstatus/templates/stats/base.html
Show inline comments
 
deleted file
ennstatus/templates/stats/worldmap.html
Show inline comments
 
deleted file
requirements.in
Show inline comments
 
Flask-Bootstrap==3.3.5.3
 
Flask-Mail==0.9.1
 
Flask-WTF==0.12
 
Flask==0.10.1
 
pygal==1.6.1
 
pygeoip==0.3.2
 
python-gnupg==0.3.7
requirements.txt
Show inline comments
 
blinker==1.3
 
docutils==0.12
 
dominate==2.1.12
 
Flask-Bootstrap==3.3.5.3
 
Flask-Mail==0.9.1
 
Flask-WTF==0.12
 
Flask==0.10.1
 
humanize==0.5.1
 
itsdangerous==0.24
 
Jinja2==2.7.3
 
lxml==3.4.2
 
MarkupSafe==0.23
 
pygal==1.6.2
 
pygeoip==0.3.2
 
Pygments==2.0.1
 
python-gnupg==0.3.7
 
requests==2.5.0
 
Werkzeug==0.10.4
 
WTForms==2.0.2
0 comments (0 inline, 0 general)