diff --git a/flaskapp/__init__.py b/flaskapp/__init__.py index b57ed6c..dafe301 100644 --- a/flaskapp/__init__.py +++ b/flaskapp/__init__.py @@ -18,7 +18,7 @@ from flask import request from cachetools import TTLCache, cached from werkzeug.utils import secure_filename # 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_DEFAULT_SENDER']="andis@fet.at" app.config['FREEZER_DESTINATION_IGNORE']=['*.zip',"*intern*"] @@ -58,8 +58,8 @@ def load_lvas_folders_studien(): studien[fn]=data - with open(os.path.join("test.yaml"),"w") as f: - f.write(yaml.dump(studien)) + #with open(os.path.join("test.yaml"),"w") as f: + # f.write(yaml.dump(studien)) # create a lva list from the structure for studium, lvaliste in studien.items(): @@ -68,8 +68,8 @@ def load_lvas_folders_studien(): lvas+=[lva] folders={} - with open(os.path.join("testlvaliste.yaml"),"w") as f: - f.write(yaml.dump(lvas)) + #with open(os.path.join("testlvaliste.yaml"),"w") as f: + # f.write(yaml.dump(lvas)) # make folders compact in lva for lva in lvas: for l in lva["courses"]: @@ -166,6 +166,6 @@ def api_index(name='index'): def url_freeze(): 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.add_url_rule('%s/' % cfg.url_prefix,'page', post) diff --git a/python_requirements.txt b/python_requirements.txt index 4712173..7946709 100644 --- a/python_requirements.txt +++ b/python_requirements.txt @@ -1,4 +1,5 @@ config slugify flask -Frozen-Flask \ No newline at end of file +Frozen-Flask +gevent \ No newline at end of file diff --git a/test2.js b/test2.js deleted file mode 100644 index d5a84b5..0000000 --- a/test2.js +++ /dev/null @@ -1 +0,0 @@ -console.log(process.argv[2]) \ No newline at end of file diff --git a/test.js b/tests/test.js similarity index 93% rename from test.js rename to tests/test.js index e40abd0..628c4e0 100644 --- a/test.js +++ b/tests/test.js @@ -1,8 +1,8 @@ const puppeteer = require('puppeteer'); const cheerio = require('cheerio'); const fs = require("fs"); -const {read_html, du_unizeug} = require("./lib"); -const tissparse = require("./tissparse"); +const {read_html, du_unizeug} = require("../nodelib/libb"); +const tissparse = require("../nodelib/tissparsee"); const YAML = require("yaml"); diff --git a/tests/test2.js b/tests/test2.js new file mode 100644 index 0000000..6568544 --- /dev/null +++ b/tests/test2.js @@ -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) +})