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

Unified Diff: app.py

Issue 12211015: Better unicode output processing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-build
Patch Set: Fix Python 2.6 encode keyword error. 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..4e64118ad2a014124fe34aa71cc3cc023dbdbd3a 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', 'replace')
+ 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