Removing deprecated functions xrange and cmp
The functions xrange() and cmp() are not supported in python3. This commit removes usage of these two. Reference - https://docs.python.org/3.0/whatsnew/3.0.html Change-Id: I26fd0d6a06cd2ddb32da17c4d6d7329d773f7828
This commit is contained in:
parent
c6d1225686
commit
5a0a161fd1
@ -202,7 +202,7 @@ class DetailView(tables.DataTableView):
|
|||||||
# There could be another table with the same name and different
|
# There could be another table with the same name and different
|
||||||
# arity. Divide the rows into unnamed columns. Number them for
|
# arity. Divide the rows into unnamed columns. Number them for
|
||||||
# internal reference.
|
# internal reference.
|
||||||
for i in xrange(0, row_len):
|
for i in range(0, row_len):
|
||||||
col_name = str(i)
|
col_name = str(i)
|
||||||
column_names.append(col_name)
|
column_names.append(col_name)
|
||||||
table_class_attrs[col_name] = tables.Column(
|
table_class_attrs[col_name] = tables.Column(
|
||||||
@ -226,7 +226,7 @@ class DetailView(tables.DataTableView):
|
|||||||
try:
|
try:
|
||||||
row_data = row['data']
|
row_data = row['data']
|
||||||
row.delete_by_key('data')
|
row.delete_by_key('data')
|
||||||
for i in xrange(0, num_cols):
|
for i in range(0, num_cols):
|
||||||
row.set_value(column_names[i], row_data[i])
|
row.set_value(column_names[i], row_data[i])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg_args = {
|
msg_args = {
|
||||||
|
@ -98,7 +98,9 @@ class CreateConditions(workflows.Step):
|
|||||||
|
|
||||||
def _compare_mapping_columns(self, x, y):
|
def _compare_mapping_columns(self, x, y):
|
||||||
# x = "mapping_column_<int>", y = "mapping_column_<int>"
|
# x = "mapping_column_<int>", y = "mapping_column_<int>"
|
||||||
return cmp(int(x.split('_')[-1]), int(y.split('_')[-1]))
|
x = int(x.split('_')[-1])
|
||||||
|
y = int(y.split('_')[-1])
|
||||||
|
return (x > y) - (x < y)
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
# Overriding parent method to add extra template context variables.
|
# Overriding parent method to add extra template context variables.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user