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

Unified Diff: third_party/logilab/common/table.py

Issue 739393004: Revert "Revert "pylint: upgrade to 1.3.1"" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 6 years, 1 month 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 | « third_party/logilab/common/shellutils.py ('k') | third_party/logilab/common/tasksqueue.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/common/table.py
===================================================================
--- third_party/logilab/common/table.py (revision 293047)
+++ third_party/logilab/common/table.py (working copy)
@@ -1,4 +1,4 @@
-# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
@@ -16,8 +16,12 @@
# You should have received a copy of the GNU Lesser General Public License along
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
"""Table management module."""
+
+from __future__ import print_function
+
__docformat__ = "restructuredtext en"
+from six.moves import range
class Table(object):
"""Table defines a data table with column and row names.
@@ -48,6 +52,8 @@
else:
return list(self) == list(other)
+ __hash__ = object.__hash__
+
def __ne__(self, other):
return not self == other
@@ -440,7 +446,7 @@
# The first cell <=> an empty one
col_names_line = [' '*col_start]
for col_name in self.col_names:
- col_names_line.append(col_name.encode('iso-8859-1') + ' '*5)
+ col_names_line.append(col_name + ' '*5)
lines.append('|' + '|'.join(col_names_line) + '|')
max_line_length = len(lines[0])
@@ -448,7 +454,7 @@
for row_index, row in enumerate(self.data):
line = []
# First, build the row_name's cell
- row_name = self.row_names[row_index].encode('iso-8859-1')
+ row_name = self.row_names[row_index]
line.append(row_name + ' '*(col_start-len(row_name)))
# Then, build all the table's cell for this line.
@@ -648,7 +654,7 @@
'table.py', 'exec'))
self.rules.append(rule)
except SyntaxError:
- print "Bad Stylesheet Rule : %s [skipped]"%rule
+ print("Bad Stylesheet Rule : %s [skipped]" % rule)
def add_rowsum_rule(self, dest_cell, row_index, start_col, end_col):
@@ -743,7 +749,7 @@
def render_row_cell(self, row_name, table, table_style):
"""Renders the cell for 'row_id' row
"""
- cell_value = row_name.encode('iso-8859-1')
+ cell_value = row_name
return self._render_cell_content(cell_value, table_style, 0)
@@ -750,7 +756,7 @@
def render_col_cell(self, col_name, table, table_style):
"""Renders the cell for 'col_id' row
"""
- cell_value = col_name.encode('iso-8859-1')
+ cell_value = col_name
col_index = table.col_names.index(col_name)
return self._render_cell_content(cell_value, table_style, col_index +1)
« no previous file with comments | « third_party/logilab/common/shellutils.py ('k') | third_party/logilab/common/tasksqueue.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698