mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 16:10:06 +01:00
tools: change direct type check to isinstance
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1072>
This commit is contained in:
parent
5e235a6546
commit
15af1c0017
1 changed files with 2 additions and 2 deletions
|
|
@ -66,10 +66,10 @@ class TableFormatter(object):
|
||||||
s = "|"
|
s = "|"
|
||||||
for w, arg in zip(self.colwidths, args):
|
for w, arg in zip(self.colwidths, args):
|
||||||
w -= 1 # width includes | separator
|
w -= 1 # width includes | separator
|
||||||
if type(arg) == str:
|
if isinstance(arg, str):
|
||||||
# We want space margins for strings
|
# We want space margins for strings
|
||||||
s += " {:{width}s} |".format(arg, width=w - 2)
|
s += " {:{width}s} |".format(arg, width=w - 2)
|
||||||
elif type(arg) == bool:
|
elif isinstance(arg, bool):
|
||||||
s += "{:^{width}s}|".format("x" if arg else " ", width=w)
|
s += "{:^{width}s}|".format("x" if arg else " ", width=w)
|
||||||
else:
|
else:
|
||||||
s += "{:^{width}d}|".format(arg, width=w)
|
s += "{:^{width}d}|".format(arg, width=w)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue