diff options
author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-09-25 07:40:31 +0000 |
---|---|---|
committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-09-25 07:40:31 +0000 |
commit | 965c28ee74d2dc1d40fad066aece537a7d77616e (patch) | |
tree | b3a5339a267a160585db628597335ab781a8328c /lnt/server | |
parent | 82dee3429ef31cca07e1160221e7ed933e60ad3d (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@372818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lnt/server')
-rw-r--r-- | lnt/server/ui/filters.py | 4 | ||||
-rw-r--r-- | lnt/server/ui/util.py | 28 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lnt/server/ui/filters.py b/lnt/server/ui/filters.py index 4ac0739..997d7c5 100644 --- a/lnt/server/ui/filters.py +++ b/lnt/server/ui/filters.py @@ -73,6 +73,6 @@ def filter_print_value(value, field_unit, field_unit_abbrev, default = '-'): 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 diff --git a/lnt/server/ui/util.py b/lnt/server/ui/util.py index eb3c7e4..bd759ce 100644 --- a/lnt/server/ui/util.py +++ b/lnt/server/ui/util.py @@ -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): |