minor fixes

This commit is contained in:
www
2020-12-25 21:38:49 +00:00
parent e707158c16
commit c20b688237
4 changed files with 29 additions and 4 deletions

3
.gitignore vendored
View File

@@ -4,4 +4,5 @@ __pycache__
*~
key.py
*.pyc
*.yaml
*.yaml
packages/*

21
ep_test.py Normal file
View File

@@ -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"))

View File

@@ -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":""})

View File

@@ -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/<path:path>')
def intern_web(path):
return render_template("wiki.html", slug=slugify(path), content="<div>ewfwef</div>")
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)