div aenderung

This commit is contained in:
www
2021-01-17 19:14:55 +00:00
parent 49c7387592
commit 9e805feb40
5 changed files with 24 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ from flask import request
from cachetools import TTLCache, cached from cachetools import TTLCache, cached
from werkzeug.utils import secure_filename from werkzeug.utils import secure_filename
# Initialize application # Initialize application
app = Flask(__name__) app = Flask(__name__,static_url_path="/bsp/static")
app.config['MAIL_SERVER']= "buran.htu.tuwien.ac.at" app.config['MAIL_SERVER']= "buran.htu.tuwien.ac.at"
app.config['MAIL_DEFAULT_SENDER']="andis@fet.at" app.config['MAIL_DEFAULT_SENDER']="andis@fet.at"
app.config['FREEZER_DESTINATION_IGNORE']=['*.zip',"*intern*"] app.config['FREEZER_DESTINATION_IGNORE']=['*.zip',"*intern*"]
@@ -58,8 +58,8 @@ def load_lvas_folders_studien():
studien[fn]=data studien[fn]=data
with open(os.path.join("test.yaml"),"w") as f: #with open(os.path.join("test.yaml"),"w") as f:
f.write(yaml.dump(studien)) # f.write(yaml.dump(studien))
# create a lva list from the structure # create a lva list from the structure
for studium, lvaliste in studien.items(): for studium, lvaliste in studien.items():
@@ -68,8 +68,8 @@ def load_lvas_folders_studien():
lvas+=[lva] lvas+=[lva]
folders={} folders={}
with open(os.path.join("testlvaliste.yaml"),"w") as f: #with open(os.path.join("testlvaliste.yaml"),"w") as f:
f.write(yaml.dump(lvas)) # f.write(yaml.dump(lvas))
# make folders compact in lva # make folders compact in lva
for lva in lvas: for lva in lvas:
for l in lva["courses"]: for l in lva["courses"]:
@@ -166,6 +166,6 @@ def api_index(name='index'):
def url_freeze(): def url_freeze():
yield "/" yield "/"
app.register_blueprint(page_blueprint, url_prefix=app.config["url_prefix"],static_folder='static') app.register_blueprint(page_blueprint, url_prefix=app.config["url_prefix"],static_folder='static',static_url_path="bsp/static")
app.register_blueprint(api_blueprint, url_prefix=app.config["url_prefix"]+"/api/",static_folder='static') app.register_blueprint(api_blueprint, url_prefix=app.config["url_prefix"]+"/api/",static_folder='static')
#app.add_url_rule('%s/<path:name>' % cfg.url_prefix,'page', post) #app.add_url_rule('%s/<path:name>' % cfg.url_prefix,'page', post)

View File

@@ -1,4 +1,5 @@
config config
slugify slugify
flask flask
Frozen-Flask Frozen-Flask
gevent

View File

@@ -1 +0,0 @@
console.log(process.argv[2])

View File

@@ -1,8 +1,8 @@
const puppeteer = require('puppeteer'); const puppeteer = require('puppeteer');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const fs = require("fs"); const fs = require("fs");
const {read_html, du_unizeug} = require("./lib"); const {read_html, du_unizeug} = require("../nodelib/libb");
const tissparse = require("./tissparse"); const tissparse = require("../nodelib/tissparsee");
const YAML = require("yaml"); const YAML = require("yaml");

14
tests/test2.js Normal file
View File

@@ -0,0 +1,14 @@
const cheerio = require('cheerio');
const fs = require("fs");
const {read_html, du_unizeug, fetch_page, merge_folders_courselist} = require("./nodelib/lib");
const tissparse = require("./nodelib/tissparse");
read_html("data/etit.yaml.html").then((body) => {
//console.log(tissparse.courselist(body));
folders=du_unizeug()
let courselist=merge_folders_courselist(tissparse.courselist(body),folders);
console.log(courselist)
})