From 6ac820bf11697a33555b1d321025c1edf4145a3f Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Thu, 2 Apr 2015 15:59:57 -0400 Subject: simplify restify --- famille.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/famille.py b/famille.py index 634090c..57be38d 100644 --- a/famille.py +++ b/famille.py @@ -7,7 +7,6 @@ import hashlib from pytz import timezone import pytz from docutils import core -from docutils.writers.html4css1 import Writer from datetime import datetime import time from email import utils @@ -21,8 +20,7 @@ locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') def rstify(string): - w = Writer() - result = smartypants(core.publish_parts(string, writer=w)['fragment'], + result = smartypants(core.publish_parts(string, writer_name='html')['fragment'], Attr.set2 | Attr.w) return result @@ -31,7 +29,6 @@ app = Flask(__name__) app.config.from_envvar('CONF') mail = Mail(app) - @app.template_filter('shortify') def shortify(string): soup = BeautifulSoup(string) -- cgit v1.2.3-70-g09d2