diff --git a/.gitignore b/.gitignore index 34ece95..149b8a2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ __pycache__ *~ key.py *.pyc -*.yaml \ No newline at end of file +*.yaml +packages/* \ No newline at end of file diff --git a/ep_test.py b/ep_test.py new file mode 100644 index 0000000..3961352 --- /dev/null +++ b/ep_test.py @@ -0,0 +1,21 @@ +from wiki.api import EtherpadLiteLazyAPI +import logging + +logging.basicConfig( + level=logging.DEBUG, + handlers=[#logging.FileHandler("example1.log"), + logging.StreamHandler()]) +logger=logging.getLogger(__name__) +logger.debug("Starting Test ...") + +ep=EtherpadLiteLazyAPI( + url="http://etherpad:9101", + keyfile="etherpad/APIKEY.txt", + groupmapper="fetwiki" + ) + +print(ep.padExists("test")) +print(ep.getPadHTML("test")) +print(ep.createPadifNotExists("test")) +print(ep.setPadHTML("test","sdf")) +print(ep.getPadLink("test")) \ No newline at end of file diff --git a/solrfet2020/__init__.py b/solrfet2020/__init__.py index 79cedc2..cce1871 100644 --- a/solrfet2020/__init__.py +++ b/solrfet2020/__init__.py @@ -30,7 +30,6 @@ class SolrFet2020(): self.solr.add(p) m=member_to_solr(fetmember.find({"nickname":""})) # search all members self.solr.add(m) - #print(m) def reindextest(self): m=fetmember.find({"nickname":""}) diff --git a/test2.py b/test2.py index be34bef..b69b97d 100644 --- a/test2.py +++ b/test2.py @@ -14,7 +14,7 @@ import os from bot1.chats import ChatManager from bot1 import users from solrfet2020 import SolrFet2020 - +from slugify import slugify #logging.basicConfig(level=logging.INFO) URL_HOSTNAME='bot.2020.fet.at' @@ -26,6 +26,7 @@ bot.init_app(app) chats=ChatManager(bot.bot) solr=SolrFet2020() + @app.route('/') def home(): query=request.args.get("query") @@ -60,6 +61,9 @@ def auth_user(user_id, token): print("authenticating") return "development" +@app.route('/intern/') +def intern_web(path): + return render_template("wiki.html", slug=slugify(path), content="
ewfwef
") def download_file(url): local_filename = url.split('/')[-1] @@ -81,4 +85,4 @@ def bot_update(update): print(yaml.dump(update.to_array())) chats.process_update(update) -app.run(host="0.0.0.0",port="5000",debug=True) +app.run(host="0.0.0.0",port="5001",debug=True)