Skip to content

Commit 1e92ad8

Browse files
author
Thomas Preud'homme
committed
[LNT] rename object variables
Rename variables named object to obj to avoid confusion with the object type. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67967 llvm-svn: 372818
1 parent 0cf7cfc commit 1e92ad8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lnt/server/ui/filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ def filter_print_value(value, field_unit, field_unit_abbrev, default = '-'):
7373

7474

7575
def register(env):
76-
for name, object in globals().items():
76+
for name, obj in globals().items():
7777
if name.startswith('filter_'):
78-
env.filters[name[7:]] = object
78+
env.filters[name[7:]] = obj

lnt/server/ui/util.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def prependLines(prependStr, str):
8484
return ('\n' + prependStr).join(str.splitlines())
8585

8686

87-
def pprint(object, useRepr=True):
87+
def pprint(obj, useRepr=True):
8888
def recur(ob):
8989
return pprint(ob, useRepr)
9090

@@ -97,16 +97,16 @@ def wrapString(prefix, string, suffix):
9797
def pprintArgs(name, args):
9898
return wrapString(name + '(', ',\n'.join(map(recur, args)), ')')
9999

100-
if isinstance(object, tuple):
101-
return wrapString('(', ',\n'.join(map(recur, object)),
102-
[')', ',)'][len(object) == 1])
103-
elif isinstance(object, list):
104-
return wrapString('[', ',\n'.join(map(recur, object)), ']')
105-
elif isinstance(object, set):
106-
return pprintArgs('set', list(object))
107-
elif isinstance(object, dict):
100+
if isinstance(obj, tuple):
101+
return wrapString('(', ', \n'.join(map(recur, obj)),
102+
[')', ',)'][len(obj) == 1])
103+
elif isinstance(obj, list):
104+
return wrapString('[', ', \n'.join(map(recur, obj)), ']')
105+
elif isinstance(obj, set):
106+
return pprintArgs('set', list(obj))
107+
elif isinstance(obj, dict):
108108
elts = []
109-
for k, v in object.items():
109+
for k, v in obj.items():
110110
kr = recur(k)
111111
vr = recur(v)
112112
elts.append('%s : %s' % (kr,
@@ -116,12 +116,12 @@ def pprintArgs(name, args):
116116
return wrapString('{', ',\n'.join(elts), '}')
117117
else:
118118
if useRepr:
119-
return repr(object)
120-
return str(object)
119+
return repr(obj)
120+
return str(obj)
121121

122122

123-
def prefixAndPPrint(prefix, object, useRepr=True):
124-
return prefix + prependLines(' ' * len(prefix), pprint(object, useRepr))
123+
def prefixAndPPrint(prefix, obj, useRepr=True):
124+
return prefix + prependLines(' ' * len(prefix), pprint(obj, useRepr))
125125

126126

127127
def clamp(v, minVal, maxVal):

0 commit comments

Comments
 (0)