minor fixes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ __pycache__
|
||||
key.py
|
||||
*.pyc
|
||||
*.yaml
|
||||
packages/*
|
||||
21
ep_test.py
Normal file
21
ep_test.py
Normal 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"))
|
||||
@@ -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":""})
|
||||
|
||||
8
test2.py
8
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/<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)
|
||||
|
||||
Reference in New Issue
Block a user