mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 12:06:08 +00:00
wa: PEP8 Fixes
This commit is contained in:
parent
97cf0ac059
commit
e8b0d42758
@ -17,7 +17,7 @@ from wa.framework import pluginloader, signal
|
||||
from wa.framework.command import Command, ComplexCommand, SubCommand
|
||||
from wa.framework.configuration import settings
|
||||
from wa.framework.configuration.core import Status
|
||||
from wa.framework.exception import (CommandError, ConfigError, HostError, InstrumentError, #pylint: disable=redefined-builtin
|
||||
from wa.framework.exception import (CommandError, ConfigError, HostError, InstrumentError, # pylint: disable=redefined-builtin
|
||||
JobError, NotFoundError, OutputProcessorError,
|
||||
PluginLoaderError, ResourceError, TargetError,
|
||||
TargetNotRespondingError, TimeoutError, ToolError,
|
||||
|
@ -240,6 +240,7 @@ def create_uiauto_project(path, name):
|
||||
wfh.write(render_template(os.path.join('uiauto', 'UiAutomation.java'),
|
||||
{'name': name, 'package_name': package_name}))
|
||||
|
||||
|
||||
# Mapping of workload types to their corresponding creation method
|
||||
create_funcs = {
|
||||
'basic': create_template_workload,
|
||||
@ -266,5 +267,5 @@ def get_class_name(name, postfix=''):
|
||||
|
||||
|
||||
def touch(path):
|
||||
with open(path, 'w') as _:
|
||||
with open(path, 'w') as _: # NOQA
|
||||
pass
|
||||
|
@ -61,7 +61,7 @@ def _get_terminal_size_windows():
|
||||
sizex = right - left + 1
|
||||
sizey = bottom - top + 1
|
||||
return sizex, sizey
|
||||
except:
|
||||
except: # NOQA
|
||||
pass
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ def _get_terminal_size_tput():
|
||||
cols = int(subprocess.check_call(shlex.split('tput cols')))
|
||||
rows = int(subprocess.check_call(shlex.split('tput lines')))
|
||||
return (cols, rows)
|
||||
except:
|
||||
except: # NOQA
|
||||
pass
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ def _get_terminal_size_linux():
|
||||
cr = struct.unpack('hh',
|
||||
fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
|
||||
return cr
|
||||
except:
|
||||
except: # NOQA
|
||||
pass
|
||||
cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
|
||||
if not cr:
|
||||
@ -92,12 +92,12 @@ def _get_terminal_size_linux():
|
||||
fd = os.open(os.ctermid(), os.O_RDONLY)
|
||||
cr = ioctl_GWINSZ(fd)
|
||||
os.close(fd)
|
||||
except:
|
||||
except: # NOQA
|
||||
pass
|
||||
if not cr:
|
||||
try:
|
||||
cr = (os.environ['LINES'], os.environ['COLUMNS'])
|
||||
except:
|
||||
except: # NOQA
|
||||
return None
|
||||
return int(cr[1]), int(cr[0])
|
||||
|
||||
|
@ -59,6 +59,7 @@ def list_of_strs(value):
|
||||
raise ValueError(value)
|
||||
return list(map(str, value))
|
||||
|
||||
|
||||
list_of_strings = list_of_strs
|
||||
|
||||
|
||||
@ -71,6 +72,7 @@ def list_of_ints(value):
|
||||
raise ValueError(value)
|
||||
return list(map(int, value))
|
||||
|
||||
|
||||
list_of_integers = list_of_ints
|
||||
|
||||
|
||||
@ -652,8 +654,8 @@ def enum(args, start=0, step=1):
|
||||
n += step
|
||||
|
||||
setattr(Enum, 'levels', levels)
|
||||
setattr(Enum, 'values', [lv.value for lv in levels])
|
||||
setattr(Enum, 'names', [lv.name for lv in levels])
|
||||
setattr(Enum, 'values', [lvl.value for lvl in levels])
|
||||
setattr(Enum, 'names', [lvl.name for lvl in levels])
|
||||
|
||||
return Enum
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user