-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
35 lines (28 loc) · 1.05 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf8 -*-
"""
LibCrowdsStatistics
-------------------
Global statistics page for LibCrowds.
"""
import os
import json
from flask import current_app as app
from flask.ext.plugins import Plugin
__plugin__ = "LibCrowdsStatistics"
__version__ = json.load(open(os.path.join(os.path.dirname(__file__),
'info.json')))['version']
class LibCrowdsStatistics(Plugin):
"""Libcrowds statistics plugin class."""
def setup(self):
"""Setup the plugin."""
self.setup_blueprint()
from . import event_listeners
def setup_blueprint(self):
"""Setup blueprint."""
from .blueprint import StatisticsBlueprint
here = os.path.dirname(os.path.abspath(__file__))
template_folder = os.path.join(here, 'templates')
static_folder = os.path.join(here, 'static')
blueprint = StatisticsBlueprint(template_folder=template_folder,
static_folder=static_folder)
app.register_blueprint(blueprint, url_prefix="/statistics")