[LNT] r372818 - [LNT] rename object variables
Thomas Preud'homme via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 00:40:32 PDT 2019
Author: thopre
Date: Wed Sep 25 00:40:31 2019
New Revision: 372818
URL: http://llvm.org/viewvc/llvm-project?rev=372818&view=rev
Log:
[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
Modified:
lnt/trunk/lnt/server/ui/filters.py
lnt/trunk/lnt/server/ui/util.py
Modified: lnt/trunk/lnt/server/ui/filters.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/filters.py?rev=372818&r1=372817&r2=372818&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/filters.py (original)
+++ lnt/trunk/lnt/server/ui/filters.py Wed Sep 25 00:40:31 2019
@@ -73,6 +73,6 @@ def filter_print_value(value, field_unit
def register(env):
- for name, object in globals().items():
+ for name, obj in globals().items():
if name.startswith('filter_'):
- env.filters[name[7:]] = object
+ env.filters[name[7:]] = obj
Modified: lnt/trunk/lnt/server/ui/util.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=372818&r1=372817&r2=372818&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/util.py (original)
+++ lnt/trunk/lnt/server/ui/util.py Wed Sep 25 00:40:31 2019
@@ -84,7 +84,7 @@ def prependLines(prependStr, str):
return ('\n' + prependStr).join(str.splitlines())
-def pprint(object, useRepr=True):
+def pprint(obj, useRepr=True):
def recur(ob):
return pprint(ob, useRepr)
@@ -97,16 +97,16 @@ def pprint(object, useRepr=True):
def pprintArgs(name, args):
return wrapString(name + '(', ',\n'.join(map(recur, args)), ')')
- if isinstance(object, tuple):
- return wrapString('(', ',\n'.join(map(recur, object)),
- [')', ',)'][len(object) == 1])
- elif isinstance(object, list):
- return wrapString('[', ',\n'.join(map(recur, object)), ']')
- elif isinstance(object, set):
- return pprintArgs('set', list(object))
- elif isinstance(object, dict):
+ if isinstance(obj, tuple):
+ return wrapString('(', ', \n'.join(map(recur, obj)),
+ [')', ',)'][len(obj) == 1])
+ elif isinstance(obj, list):
+ return wrapString('[', ', \n'.join(map(recur, obj)), ']')
+ elif isinstance(obj, set):
+ return pprintArgs('set', list(obj))
+ elif isinstance(obj, dict):
elts = []
- for k, v in object.items():
+ for k, v in obj.items():
kr = recur(k)
vr = recur(v)
elts.append('%s : %s' % (kr,
@@ -116,12 +116,12 @@ def pprint(object, useRepr=True):
return wrapString('{', ',\n'.join(elts), '}')
else:
if useRepr:
- return repr(object)
- return str(object)
+ return repr(obj)
+ return str(obj)
-def prefixAndPPrint(prefix, object, useRepr=True):
- return prefix + prependLines(' ' * len(prefix), pprint(object, useRepr))
+def prefixAndPPrint(prefix, obj, useRepr=True):
+ return prefix + prependLines(' ' * len(prefix), pprint(obj, useRepr))
def clamp(v, minVal, maxVal):
More information about the llvm-commits
mailing list