<commit_before>'''
Created on 14.8.2012

@author: ttiurani
'''
from troikagame import app
from security import validate_login, register, hash_password, get_troika_access_right, activatable
from backend import *
from forms import *
from flask import request, session, flash, redirect, url_for, render_template
import time

@app.route('/front')
def front():
    return redirect(url_for('troikas'))

@app.route('/about', methods=['GET'])
def about():
    return render_template('about.html')

@app.route('/')
def troikas():
    active_troikas = get_active_troikas()
    active_entries = [dict(id=active_troika.id,
                        start_time=active_troika.start_time, 
                        title=active_troika.title, 
                        description=active_troika.description) 
               for active_troika in active_troikas]
    pending_troikas = get_pending_troikas()
    pending_entries = [dict(id=pending_troika.id,
                        start_time=pending_troika.start_time, <commit_msg>Added hack to get trailing slash to the address from http://flask.pocoo.org/mailinglist/archive/2011/2/3/route-isn-t-adding-a-trailing-slash/#fce0d413f447cad621db84a3b610e1fb<commit_after>'''
Created on 14.8.2012

@author: ttiurani
'''
from troikagame import app
from security import validate_login, register, hash_password, get_troika_access_right, activatable
from backend import *
from forms import *
from flask import request, session, flash, redirect, url_for, render_template
import time

@app.route('/about', methods=['GET'])
def about():
    return render_template('about.html')

@app.route('/')
def troikas():
    if ('REQUEST_URI' in request.environ and
        not request.environ['REQUEST_URI'].endswith('/')):
        return redirect(url_for('troikas').rstrip('/') + '/')
    
    active_troikas = get_active_troikas()
    active_entries = [dict(id=active_troika.id,
                        start_time=active_troika.start_time, 
                        title=active_troika.title, 
                        description=active_troika.description) 
               for active_troika in active_troikas]
    pending_troikas = get_pending_troikas()
    pending_entries = [dict(id=pending_troika.id,
                        start_time=pending_troika.start_time, 
{'fraction_non_alphanumeric': 0.1054945054945055, 'fraction_numerical': 0.016263736263736263, 'mean_word_length': 3.402321083172147, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2957504', 'n_tokens_mistral': 754, 'n_tokens_neox': 687, 'n_words': 144}