Index: __init__.py
===================================================================
--- __init__.py (revision 6069)
+++ __init__.py (working copy)
@@ -1 +1 @@
-# empty
+from wp import *
Index: wp.py
===================================================================
--- wp.py (revision 6069)
+++ wp.py (working copy)
@@ -17,7 +17,9 @@
#from trac.mimeview.api import IHTMLPreviewRenderer, MIME_MAP
#from trac.util import escape
-from trac.util.html import html, Markup, escape
+from genshi.core import Markup
+from genshi.builder import tag
-from trac.web import HTTPNotFound, RequestDone, IRequestHandler
+from trac.resource import ResourceNotFound
+from trac.web import RequestDone, IRequestHandler
from trac.web.chrome import ITemplateProvider, INavigationContributor
@@ -84,6 +86,6 @@
raise Exception("unknown user")
if self._jpegPhoto_width:
- return Markup(html.IMG(src=req.href.user("%s/jpegPhoto" % uid), alt=rn, width=self._jpegPhoto_width))
- return Markup(html.IMG(src=req.href.user("%s/jpegPhoto" % uid), alt=rn))
+ return tag.img(src=req.href.user("%s/jpegPhoto" % uid), alt=rn, width=self._jpegPhoto_width)
+ return tag.img(src=req.href.user("%s/jpegPhoto" % uid), alt=rn)
def render_macro(self, req, name, content):
@@ -108,5 +110,5 @@
def _format_link(self, formatter, ns, params, label):
- return html.a(label, href=formatter.href.user(params), title=self.get_realname(params))
+ return tag.a(label, href=formatter.href.user(params), title=self.get_realname(params))
def _format_link2(self, formatter, ns, match):
@@ -139,7 +141,7 @@
content += u"|| %s || %s || %s ||\n" % (uid,gn,sn)
- req.hdf['wp.text'] = wiki_to_html(content, self.env, req)
- req.hdf['title'] = u'Whitepages List'
- return 'wp.cs', 'text/html'
+ data = {'wp_text': wiki_to_html(content, self.env, req),
+ 'title': u'Whitepages List'}
+ return 'ldapwhitepage.html', data, 'text/html'
elif len(qs)==1:
uid=qs[0]
@@ -147,5 +149,5 @@
data=self.get_info(uid)
if not data:
- raise HTTPNotFound("uid %s not found" % uid)
+ raise ResourceNotFound("uid %s not found" % uid)
content += (u'= Whitepages Entry for %s =\n' % uid)
@@ -193,7 +195,7 @@
'''
- req.hdf['wp.text'] = wiki_to_html(content, self.env, req)
- req.hdf['title'] = (u'Whitepages Entry for %s' % uid)
- return 'wp.cs', 'text/html'
+ data = {'wp_text': wiki_to_html(content, self.env, req),
+ 'title': (u'Whitepages Entry for %s' % uid)}
+ return 'ldapwhitepage.html', data, 'text/html'
elif len(qs)==2:
@@ -212,3 +214,3 @@
- raise HTTPNotFound("File not found")
+ raise ResourceNotFound("File not found")
Index: templates/ldapwhitepage.html
===================================================================
--- templates/ldapwhitepage.html (revision 0)
+++ templates/ldapwhitepage.html (revision 0)
@@ -0,0 +1,16 @@
+
+