Changeset 2817
- Timestamp:
- 11/23/07 18:44:40 (1 year ago)
- Files:
-
- addcommentmacro/0.10/addcomment/macro.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
addcommentmacro/0.10/addcomment/macro.py
r2097 r2817 32 32 hdf['addcommentmacro'] = True 33 33 34 authname = hdf.getValue("trac.authname", "anonymous")34 authname = to_unicode(hdf.getValue("trac.authname", "anonymous")) 35 35 db = env.get_db_cnx() 36 36 perm = trac.perm.PermissionCache(env, authname) … … 56 56 submit = hdf.getValue("args.submitaddcomment", "") 57 57 if not cancel: 58 authname = hdf.getValue("args.authoraddcomment", authname)58 authname = to_unicode(hdf.getValue("args.authoraddcomment", authname)) 59 59 60 60 # Ensure [[AddComment]] is not present in comment, so that infinite … … 70 70 if preview: 71 71 out.write("<div class='wikipage' id='preview'>\n") 72 out.write("<h4 id='commentpreview'>Comment by %s on %s</h4>\n<p>\n%s\n</p>\n" % (authname, time.strftime('%c', time.localtime()), wiki_to_html(comment, env, None))) 72 out.write("<h4 id='commentpreview'>Comment by %s on %s</h4>\n<p>\n%s\n</p>\n" % ( 73 authname, to_unicode(time.strftime('%c', time.localtime())), 74 wiki_to_html(comment, env, None))) 73 75 if preview: 74 76 out.write("</div>\n") … … 80 82 for line in page.text.splitlines(): 81 83 if line.find('[[AddComment') == 0: 82 newtext.write("==== Comment by %s on %s ====\n%s\n\n" % (authname, time.strftime('%c', time.localtime()), comment)) 84 newtext.write("==== Comment by %s on %s ====\n%s\n\n" % ( 85 authname, to_unicode(time.strftime('%c', time.localtime())), 86 comment)) 83 87 submitted = True 84 88 newtext.write(line + "\n")
