Hello Simon,
PlugIn
1 # Helloworld plugin
2
3 import re
4 import MySQLdb
5
6 from genshi.builder import tag
7 from trac.core import *
8 from trac.web import IRequestHandler
9 from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet
.
.
.
61 def _page_data(self, req):
62 title = "Test"
63 wert = "Testwert"
64 return {'title': title}
.
.
.
103 data['test'] = 'schön'
104 return 'helloworld.html', data, None
Template
1 <!DOCTYPE html
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="
http://www.w3.org/1999/xhtml"
5 xmlns:py="
http://genshi.edgewall.org/"
6 xmlns:xi="
http://www.w3.org/2001/XInclude">
7 <xi:include href="layout.html" />
8 <head>
.
.
.
46 <p>$i{test}</p>
.
.
.
Trac Error
Genshi UnicodeDecodeError error while
rendering template
'/tmp/Trachelloworld-1.1-py2.6.egg-tmp/helloworld/templates/helloworld.html',
line 46, char -1
If i change the variable to:
103 data['test'] = 'schoen'
104 return 'helloworld.html', data, None
it works..
My System:
System Information
Trac |
0.12.3 |
Genshi |
0.6.1 |
mod_python |
3.3.1 |
pysqlite |
2.4.1 |
Python |
2.6.8 (unknown, May 29 2012, 22:30:44)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] |
setuptools |
0.6c8 |
SQLite |
3.7.6.3 |
jQuery: | 1.4.4 |
---|
Thanks 4 your help