equal
deleted
inserted
replaced
4 # Copyright 2005 Matt Mackall <mpm@selenic.com> |
4 # Copyright 2005 Matt Mackall <mpm@selenic.com> |
5 # |
5 # |
6 # This software may be used and distributed according to the terms |
6 # This software may be used and distributed according to the terms |
7 # of the GNU General Public License, incorporated herein by reference. |
7 # of the GNU General Public License, incorporated herein by reference. |
8 |
8 |
9 import os, cgi, sys |
9 import os, cgi, sys, urllib |
10 from demandload import demandload |
10 from demandload import demandload |
11 demandload(globals(), "mdiff time re socket zlib errno ui hg ConfigParser") |
11 demandload(globals(), "mdiff time re socket zlib errno ui hg ConfigParser") |
12 demandload(globals(), "zipfile tempfile StringIO tarfile BaseHTTPServer util") |
12 demandload(globals(), "zipfile tempfile StringIO tarfile BaseHTTPServer util") |
13 demandload(globals(), "mimetypes") |
13 demandload(globals(), "mimetypes") |
14 from node import * |
14 from node import * |
161 else: |
161 else: |
162 yield tmpl |
162 yield tmpl |
163 return |
163 return |
164 |
164 |
165 common_filters = { |
165 common_filters = { |
166 "escape": cgi.escape, |
166 "escape": lambda x: cgi.escape(x, True), |
|
167 "urlescape": urllib.quote, |
167 "strip": lambda x: x.strip(), |
168 "strip": lambda x: x.strip(), |
168 "age": age, |
169 "age": age, |
169 "date": lambda x: util.datestr(x), |
170 "date": lambda x: util.datestr(x), |
170 "addbreaks": nl2br, |
171 "addbreaks": nl2br, |
171 "obfuscate": obfuscate, |
172 "obfuscate": obfuscate, |