This commit is contained in:
Matthew Scragg 2013-12-02 17:50:19 -06:00
parent d68c6f1d4e
commit 02b6b7d592
7 changed files with 273 additions and 301 deletions

View file

@ -1,10 +1,9 @@
import rethinkdb as rdb
import redis
from realms import config
from sqlalchemy import create_engine
# Default DB connection
db = rdb.connect(config.db['host'], config.db['port'], db=config.db['dbname'])
db = create_engine(config.DB_URI, encoding='utf8', echo=True)
# Default Cache connection
cache = redis.StrictRedis(host=config.cache['host'], port=config.cache['port'])
cache = redis.StrictRedis(host=config.REDIS_HOST, port=config.REDIS_PORT)

View file

@ -1,15 +1,13 @@
import os
import re
import lxml.html
from lxml.html import clean
import ghdiff
import gittle.utils
from gittle import Gittle
from dulwich.repo import NotGitRepository
from werkzeug.utils import escape, unescape
from util import to_canonical
from models import Site
from realms.models import Site
class MyGittle(Gittle):
@ -94,7 +92,7 @@ class Wiki():
tree = lxml.html.fromstring(content)
cleaner = clean.Cleaner(remove_unknown_tags=False, kill_tags=set(['style']), safe_attrs_only=False)
cleaner = lxml.html.Cleaner(remove_unknown_tags=False, kill_tags=set(['style']), safe_attrs_only=False)
tree = cleaner.clean_html(tree)
content = lxml.html.tostring(tree, encoding='utf-8', method='html')