Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3083)

Unified Diff: app.py

Issue 12211015: Better unicode output processing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app.py
diff --git a/app.py b/app.py
index e634f28ac88874b13cc5c1c36f21aa3fc355e723..374823c21d42d969e502bd1d35bf4c844758f256 100644
--- a/app.py
+++ b/app.py
@@ -298,7 +298,8 @@ class ConsoleData(object):
@staticmethod
def ContentsToHtml(contents):
- return ''.join([str(content) for content in contents])
+ return ''.join([unicode(content).encode('ascii', errors='replace')
M-A Ruel 2013/02/05 18:11:56 Why encode to ascii and not utf-8? No need for [].
agable 2013/02/05 18:17:37 Because when you encode to utf-8 jinja2 still brea
M-A Ruel 2013/02/05 18:20:18 Probably because jinja2 wants non-encoded unicode
agable 2013/02/05 18:30:30 Done.
+ for content in contents])
@property
def last_row(self):
@@ -369,15 +370,17 @@ class ConsoleData(object):
attrvalue = re.sub(r'^(\S+).*', r'\1', attrvalue)
if attrvalue == 'DevRev':
revision = cells[0]
- self.SawRevision(revision=revision.findAll('a')[0].contents[0])
- self.SetLink(revlink=revision.findAll('a')[0].attrs[0][1])
+ self.SawRevision(self.ContentsToHtml(
+ revision.findAll('a')[0].contents[0]))
+ self.SetLink(self.ContentsToHtml(revision.findAll('a')[0].attrs[0][1]))
nameparts = cells[1].contents
- self.SetName(who=re.sub(r'^\s+(.*)\s*$',
- r'\1',
- self.ContentsToHtml(nameparts)))
+ self.SetName(re.sub(r'^\s+(.*)\s*$',
+ r'\1',
+ self.ContentsToHtml(nameparts)))
for i, bs in enumerate(cells[2:]):
- self.SetStatus(category=self.category_order[self.lastMasterSeen][i],
- status=str(bs.findAll('table', recursive=False)[0]))
+ self.SetStatus(self.category_order[self.lastMasterSeen][i],
+ self.ContentsToHtml(bs.findAll('table',
+ recursive=False)[0]))
if attrvalue == 'DevComment':
self.SetComment(comment=self.ContentsToHtml(cells[0].contents))
if attrvalue == 'DevDetails':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698