Пример #1
0
def alignment():
    return render_template(
       'alignment/enter.html',
       alignment=configurator.get("alignment"),
       session=configurator.get("session"),
       cts=configurator.get("cts")
     )
Пример #2
0
def thematic():
    return render_template(
     'treebank/theme.html',
     treebank=configurator.get("treebank"),
     session=configurator.get("session"),
     cts=configurator.get("cts")
   )
Пример #3
0
def treebank():
    return render_template(
       'treebank/enter.html',
       treebank=configurator.get("treebank"),
       session=configurator.get("session"),
       cts=configurator.get("cts")
     )
Пример #4
0
def annotation():
    if request.method == 'GET':
      return render_template(
         'annotation/enter.html',
         annotation=configurator.get("annotation"),
         session=configurator.get("session"),
         cts=configurator.get("cts")
      )
    else:
      data_dict = request.get_json()     
      data = json.dumps(data_dict, indent=2, sort_keys=True)
      raw_id = data_dict['commentary'][0]['hasBody']['@id'].encode()
      m_obj = add_to_db(data_dict)
      mil_id = raw_id.split(':').pop()
      path = "/digmil/"+mil_id+".txt"
      session['path'] = path
      session['obj'] = str(m_obj)
      with open(HOME+path, "wb") as mil_file:
        mil_file.write(data)
      return redirect(url_for('save_data'))
Пример #5
0
def get_locale():
    return request.accept_languages.best_match(
        configurator.get("language")("available").keys())
Пример #6
0
from flask import Flask
from flask.ext.babel import Babel
from flask_bower import Bower
from app import configurator
from app.cache import cache
from flask.ext.cors import CORS
from flask.ext.pymongo import PyMongo

app = Flask(__name__, template_folder="templates")
cors = CORS(app)
babel = Babel(app)
bower = Bower(app)
mongo = PyMongo(app)
load = configurator.get("modules")("load")
cache.init_app(app,config={'CACHE_TYPE': 'simple'})

from app import views
from flask import Flask
from flask.ext.babel import Babel
from flask_bower import Bower
from app import configurator
from app.cache import cache
from flask.ext.cors import CORS

app = Flask(__name__, template_folder="templates")
cors = CORS(app)
babel = Babel(app)
bower = Bower(app)
load = configurator.get("modules")("load")
cache.init_app(app, config={'CACHE_TYPE': 'simple'})

if "capitains-ahab" in load:
    from Ahab import ahab
    app.register_blueprint(ahab)

from joth import joth

app.register_blueprint(joth)

from app import views
Пример #8
0
def get_locale():
    return request.accept_languages.best_match(configurator.get("language")("available").keys())