Fix flake8 linting issues.
This commit is contained in:
parent
5ebf6c8aa1
commit
2305ac05bd
|
@ -91,9 +91,9 @@ class NeoHubCLI(object):
|
||||||
arg_types = []
|
arg_types = []
|
||||||
for p in sig.parameters:
|
for p in sig.parameters:
|
||||||
a = sig.parameters[p].annotation
|
a = sig.parameters[p].annotation
|
||||||
if type(a) == type:
|
if isinstance(a, type):
|
||||||
arg_types.append(a)
|
arg_types.append(a)
|
||||||
elif type(a) == list:
|
elif isinstance(a, list):
|
||||||
if a[0] == NeoStat:
|
if a[0] == NeoStat:
|
||||||
arg_types.append(a[0])
|
arg_types.append(a[0])
|
||||||
else:
|
else:
|
||||||
|
@ -204,14 +204,14 @@ class NeoHubCLI(object):
|
||||||
if special_case:
|
if special_case:
|
||||||
return special_case(raw_result, output_format)
|
return special_case(raw_result, output_format)
|
||||||
|
|
||||||
if type(raw_result) == bool:
|
if isinstance(raw_result, bool):
|
||||||
return 'Command Succeeded' if raw_result else 'Command Failed'
|
return 'Command Succeeded' if raw_result else 'Command Failed'
|
||||||
|
|
||||||
if type(raw_result) in (int, str):
|
if type(raw_result) in (int, str):
|
||||||
return f'{raw_result}'
|
return f'{raw_result}'
|
||||||
|
|
||||||
if type(raw_result) != types.SimpleNamespace:
|
if not isinstance(raw_result, types.SimpleNamespace):
|
||||||
if type(raw_result) == dict:
|
if isinstance(raw_result, dict):
|
||||||
raw_result = types.SimpleNamespace(**raw_result)
|
raw_result = types.SimpleNamespace(**raw_result)
|
||||||
else:
|
else:
|
||||||
raise NeoHubCLIInternalError(
|
raise NeoHubCLIInternalError(
|
||||||
|
@ -225,7 +225,7 @@ class NeoHubCLI(object):
|
||||||
"""
|
"""
|
||||||
if type(val) in (ScheduleFormat, Weekday):
|
if type(val) in (ScheduleFormat, Weekday):
|
||||||
return val.value
|
return val.value
|
||||||
elif type(val) == NeoStat:
|
elif isinstance(val, NeoStat):
|
||||||
return f'[NeoStat: {val.name}]'
|
return f'[NeoStat: {val.name}]'
|
||||||
else:
|
else:
|
||||||
return val
|
return val
|
||||||
|
|
Loading…
Reference in New Issue