constance

Scripts for generating (an earlier obsolete version of) my personal web site
git clone https://code.djc.id.au/git/constance/
commit 7d45e6caae8703c4ca536901b592f14ad99d5ae7
parent ac25f3317fba9676e75924a97dd9f5e66f090931
Author: Dan Callaghan <djc@djc.id.au>
Date:   Wed, 19 Nov 2008 20:08:58 +1000

backing out of f4b12a213e83 since it is too sloooooow

Diffstat:
Mblog.py | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/blog.py b/blog.py
@@ -1,7 +1,6 @@
 import os, re, uuid, email
 from datetime import datetime
 import genshi
-from smartypants import smartyPants
 import yaml
 
 
@@ -22,10 +21,6 @@ def cleanup_metadata(header_items):
         cleaned[k] = v
     return cleaned
 
-def smartypants_parse(s):
-    return smartyPants(s, attr='2') # attr adds -- and --- support
-
-
 IDIFY_WHITESPACE_PATT = re.compile(r'(?u)\s+')
 IDIFY_ACCEPT_PATT = re.compile(r'(?u)\w|[-_]')
 def idify(s):
@@ -98,7 +93,7 @@ class BlogEntry(object):
         # not really a MIME document, but parse it like one
         msg = email.message_from_file(open(os.path.join(self.dir, 'content.txt'), 'r'))
         self.metadata = cleanup_metadata(msg.items())
-        self.body = smartypants_parse(msg.get_payload().decode('utf8')) # XXX encoding
+        self.body = msg.get_payload().decode('utf8') # XXX encoding
         self.title = self.metadata['title']
 
         raw_tags = self.metadata.get('tags', '').strip()