urlchars = r'[A-Za-z0-9/:@_%~#=&\.\-\?\+\$,]+'
urlendchar = r'[A-Za-z0-9/]'
-url = r'["=]?((about|gopher|http|https|ftp|mailto|file):%s)' % \
+url = r'["=]?((about|file|ftp|gopher|http|https|mailto|news|telnet):%s)' % \
(urlchars+urlendchar)
def _url2href(match):
class phd_pp(Template):
def __init__(self, *args, **kw):
+ if not hasattr(self, "_fileBaseName"):
+ self._fileDirName, self._fileBaseName = os.path.split(os.path.abspath(self._CHEETAH_src))
Template.__init__(self, *args, **kw)
directories = self._fileDirName.split('/')[full_dirs:] # remove directories up to "./files"
dirs_to_root = len(directories)
body = parts["body"].encode(encoding)
parts = [part for part in (title, subtitle, body) if part]
return "\n\n".join(parts)
+
+ def img_thumbnail_800_1024(self, img_name):
+ return """\
+<img src="%(img_name)s-thumbnail.jpg" alt="%(img_name)s-thumbnail.jpg" /><br />
+<a href="%(img_name)s-800x600.jpg">800x600</a>, <a href="%(img_name)s-1024x800.jpg">1024x800</a>""" % {"img_name": img_name}