Exemplo n.º 1
0
def index_xw(width, user_scalable=False):
    fp = util.get_webres_path('index.html')
    with open(fp, encoding='utf-8') as fd:
        data = fd.read()
    data = data.replace("%SCALABLE%", "1" if user_scalable else "0")
    data = data.replace("%WIDTH%", str(width))
    response.content_type = "text/html; charset=UTF-8"
    return data
Exemplo n.º 2
0
def index():
    response.content_type = 'text/javascript; charset=UTF-8'
    cfg = json.dumps({
        "lang": request.lang,
        "lc": request.lc,
        "latin": request.latin,
        "nonce": nonce,
    })
    fp = util.get_webres_path('i18n/%s.json') % request.lang
    with open(fp, encoding='utf-8') as fd:
        i18n = fd.read()
    return "g_cfg = %s;\ng_i18n = %s;" % (cfg, i18n)
Exemplo n.º 3
0
def send_static(filename):
    return static_file(filename, root=util.get_webres_path(''))
Exemplo n.º 4
0
def get_nocover(size):
    return get_cover(util.get_webres_path('img/no_cover.png'), size)