diff --git a/wa/__init__.py b/wa/__init__.py index a47792ce..f0f13980 100644 --- a/wa/__init__.py +++ b/wa/__init__.py @@ -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, diff --git a/wa/commands/create.py b/wa/commands/create.py index d47f3f9c..f2c2f479 100644 --- a/wa/commands/create.py +++ b/wa/commands/create.py @@ -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 diff --git a/wa/utils/terminalsize.py b/wa/utils/terminalsize.py index 6381653a..7b9301a3 100644 --- a/wa/utils/terminalsize.py +++ b/wa/utils/terminalsize.py @@ -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]) diff --git a/wa/utils/types.py b/wa/utils/types.py index 8be8d107..39fd4232 100644 --- a/wa/utils/types.py +++ b/wa/utils/types.py @@ -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