РАСКУРx1
This commit is contained in:
76
app/__init__.py
Normal file
76
app/__init__.py
Normal file
@@ -0,0 +1,76 @@
|
||||
from dotenv import load_dotenv
|
||||
from flask import Flask, url_for, render_template
|
||||
import os
|
||||
import json
|
||||
import numpy.random as gaussian_rnd
|
||||
|
||||
load_dotenv()
|
||||
|
||||
""".. ..,.,,,. . . .
|
||||
. . ....... ...,%&%/,.. .... .*#&&%*... .... . . .. ..
|
||||
.. .. ,.. . ...,(&% ,........,..,. ... .. .*#%/..,. .. ....,. .... . ...
|
||||
, .. .. ... .. /%*. ... .... ., ........ ..., . ,.#%#. ...,.. . ,., ,,
|
||||
..... ... ..*%/ ... ..... ............ .....,. .,.,(* ........,,..,.,..,.
|
||||
.........,.*&(. ... .......... . ....... ..,/*.,,,. *& . .....,,....,...,
|
||||
.,........,(,.. . . ...../*..,. ..%*,...., ......... .
|
||||
*. .... (%, *#.,.,,,,#% .**(#.,,,./&.%, .... .... ......
|
||||
,....... (% .#.,,*#*,,,% ,*.#,,,,,#%.#% .. .,.,..,..
|
||||
...... /@& *#&%%%&(, ./ .,/. .#% .., ....
|
||||
. . .%@@%. *@%*,**,,**,,,,..,,,....*.,.//*%#/(,@.
|
||||
.%@@@@@( .*#%%&%@%%&%%&(%#&@##@%*(%(/,..*%@#
|
||||
(@@@@&(&, /&#.,,,,...,,,,*,,***,,.&@#%.
|
||||
(@@@@&. /@* /%#*.,*..% &&##@#
|
||||
(@@@@&(, *&#. .*///(% @@#.
|
||||
.%@@@@@@@( .(%#/ ,% &% *(/.
|
||||
,@@@@@@@@@%, /##%**, ,(%. &/ .(% ..#/(**.
|
||||
,@@@@@@@@@@@/ .,,,,,,,,,,. *% &/ *%@&@%(,*&&&&%
|
||||
,@@@@@@@@@@@@@* ,@( @@@%.. ,@@&@@..#&*#&,
|
||||
,@@@@@@%@@@@@@% ,&# *##(** .#%@&#@&/
|
||||
,@@@@@@@@@@@@@@&/. @@/ *&. .&@@@@@@%.
|
||||
,@@@@@@@@@@@@@@@@@@&#(*, (@/ ,& #@@@@@@@@@
|
||||
,@@@@@%.%@@@@@@@@@@@@@@@@@@@/ .#& ,@@. &@@@@@@.
|
||||
,@@@@@% ,&@@@@@@@@@@@@@@@@@@@&(&@@@@@#(///*/%## &@@@@@@
|
||||
,@@@@@% .&@@@@@@&%&@@@@@@@@@@@@@@@@@@@@/ &@@@@@&
|
||||
,@@@@@# ,&@@@@@# ,(#&@@@@@@@@@@@@@@@@&**. &@@@@@&
|
||||
,@@@@@* .@@@@@@%. ,@@@@@@@@@@@@@@@@@@@@@@#.. ,@@@@@@*
|
||||
*@@@@@, (@@@@@@/ @@@@@@@@@./%&@@@@@@@@@@@@@@@@@%*,(@@@@@@,
|
||||
,@@@@@, .(@@@@@&/ ,@@@@@@@&. ..,(@@@@@@@@@@@@@@@@@@@@.
|
||||
#@@@@@, .(@@@@@&#@@@@@@@&* .((%%@@@@@@@@@@@&.
|
||||
#@@@@&. .&@@@@@@@@@@@#. .,*%&@@@@@%
|
||||
#@@@@&. (@@@@@@@@@ ** """
|
||||
|
||||
|
||||
app = Flask(__name__, subdomain_matching=True)
|
||||
|
||||
|
||||
def generate_iq():
|
||||
return round(gaussian_rnd.normal(loc=100.0, scale=15.0, size=None))
|
||||
|
||||
|
||||
@app.context_processor
|
||||
def override_url_for():
|
||||
return dict(url_for=dated_url_for)
|
||||
|
||||
|
||||
def dated_url_for(endpoint, **values):
|
||||
if endpoint == 'static':
|
||||
filename = values.get('filename', None)
|
||||
if filename:
|
||||
file_path = os.path.join(app.root_path, endpoint, filename)
|
||||
values['q'] = int(os.stat(file_path).st_mtime)
|
||||
return url_for(endpoint, **values)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
with open('config/json/projects.json') as file:
|
||||
data = json.loads(file.read())
|
||||
cols = data['cols']
|
||||
projects = data['projects']
|
||||
return render_template('index.html', random_number=generate_iq(), projects=projects,
|
||||
texlink=os.getenv('TEXURL'))
|
||||
|
||||
|
||||
@app.route('/', subdomain='tex')
|
||||
def texindex():
|
||||
return render_template('texindex.html')
|
Reference in New Issue
Block a user