mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 03:12:34 +01:00
pep8: Ignore line break before binary operator
PEP8 has switched its guidance [1] for where a line break should occur in relation to a binary operator, so don't raise this warning for new code and update the code base to follow the new style. [1] https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
This commit is contained in:
@@ -95,8 +95,8 @@ def diff_sysfs_dirs(before, after, result): # pylint: disable=R0914
|
||||
logger.debug('Token length mismatch in {} on line {}'.format(bfile, i))
|
||||
dfh.write('xxx ' + bline)
|
||||
continue
|
||||
if ((len([c for c in bchunks if c.strip()]) == len([c for c in achunks if c.strip()]) == 2) and
|
||||
(bchunks[0] == achunks[0])):
|
||||
if ((len([c for c in bchunks if c.strip()]) == len([c for c in achunks if c.strip()]) == 2)
|
||||
and (bchunks[0] == achunks[0])):
|
||||
# if there are only two columns and the first column is the
|
||||
# same, assume it's a "header" column and do not diff it.
|
||||
dchunks = [bchunks[0]] + [diff_tokens(b, a) for b, a in zip(bchunks[1:], achunks[1:])]
|
||||
|
@@ -79,7 +79,7 @@ def init(verbosity=logging.INFO, color=True, indent_with=4,
|
||||
root_logger.addHandler(_console_handler)
|
||||
|
||||
buffer_capacity = int(os.getenv('WA_LOG_BUFFER_CAPACITY',
|
||||
str(DEFAULT_INIT_BUFFER_CAPACITY)))
|
||||
str(DEFAULT_INIT_BUFFER_CAPACITY)))
|
||||
_init_handler = InitHandler(buffer_capacity)
|
||||
_init_handler.setLevel(logging.DEBUG)
|
||||
root_logger.addHandler(_init_handler)
|
||||
|
@@ -404,8 +404,8 @@ def istextfile(fileobj, blocksize=512):
|
||||
If more than 30% of the chars in the block are non-text, or there
|
||||
are NUL ('\x00') bytes in the block, assume this is a binary file.
|
||||
"""
|
||||
_text_characters = (b''.join(chr(i) for i in range(32, 127)) +
|
||||
b'\n\r\t\f\b')
|
||||
_text_characters = (b''.join(chr(i) for i in range(32, 127))
|
||||
+ b'\n\r\t\f\b')
|
||||
|
||||
block = fileobj.read(blocksize)
|
||||
if b'\x00' in block:
|
||||
|
@@ -155,8 +155,8 @@ class ReventRecording(object):
|
||||
else: # not streaming
|
||||
if not self._events:
|
||||
self._duration = 0
|
||||
self._duration = (self._events[-1].time -
|
||||
self._events[0].time).total_seconds()
|
||||
self._duration = (self._events[-1].time
|
||||
- self._events[0].time).total_seconds()
|
||||
return self._duration
|
||||
|
||||
@property
|
||||
|
@@ -343,7 +343,7 @@ def _read_pod(fh, fmt=None):
|
||||
fmt = os.path.splitext(fh.name)[1].lower().strip('.')
|
||||
if fmt == '':
|
||||
# Special case of no given file extension
|
||||
message = ("Could not determine format " +
|
||||
message = ("Could not determine format "
|
||||
"from file extension for \"{}\". "
|
||||
"Please specify it or modify the fmt parameter.")
|
||||
raise ValueError(message.format(getattr(fh, 'name', '<none>')))
|
||||
|
Reference in New Issue
Block a user