mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 02:01:16 +00:00
Pylint fixes
Pylint now checks for trailing new lines, this commit fixes them.
This commit is contained in:
parent
873bdf0bc7
commit
9707aa6237
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -111,4 +111,3 @@ def format_extension_parameters(extension, out, width, shift=4):
|
||||
param_texts.append(indent(param_text, shift))
|
||||
|
||||
out.write(format_column('\n'.join(param_texts), width))
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -211,4 +211,3 @@ if os.path.isfile(_packages_file):
|
||||
|
||||
for config in _env_configs:
|
||||
settings.update(config)
|
||||
|
||||
|
@ -32,4 +32,3 @@ def get_extension_type(ext):
|
||||
if isinstance(ext, cls):
|
||||
return name
|
||||
raise ValueError('Unknown extension type: {}'.format(ext.__class__.__name__))
|
||||
|
||||
|
@ -396,4 +396,3 @@ class Instrument(Extension):
|
||||
|
||||
def __repr__(self):
|
||||
return 'Instrument({})'.format(self.name)
|
||||
|
||||
|
@ -327,4 +327,3 @@ class Metric(object):
|
||||
return '<{}>'.format(result)
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
|
@ -186,4 +186,3 @@ def send(signal, sender, *args, **kwargs):
|
||||
|
||||
"""
|
||||
dispatcher.send(signal, sender, *args, **kwargs)
|
||||
|
||||
|
@ -101,4 +101,3 @@ class Workload(Extension):
|
||||
|
||||
def __str__(self):
|
||||
return '<Workload {}>'.format(self.name)
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -218,4 +218,3 @@ class Juno(BigLittleDevice):
|
||||
def get_android_id(self):
|
||||
# Android ID currenlty not set properly in Juno Android builds.
|
||||
return 'abad1deadeadbeef'
|
||||
|
||||
|
@ -35,4 +35,3 @@ class OdroidXU3(AndroidDevice):
|
||||
description='Serial port on which the device is connected'),
|
||||
Parameter('baudrate', default=115200, kind=int, description='Serial connection baud rate'),
|
||||
]
|
||||
|
||||
|
@ -847,4 +847,3 @@ def _slow_sendline(target, line):
|
||||
target.send(c)
|
||||
time.sleep(0.1)
|
||||
target.sendline('')
|
||||
|
||||
|
@ -33,4 +33,3 @@ class Xe503c12Chormebook(LinuxDevice):
|
||||
]
|
||||
|
||||
abi = 'armeabi'
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -97,4 +97,3 @@ class ChromeOsDevice(LinuxDevice):
|
||||
else:
|
||||
pass
|
||||
self.ui_status = None
|
||||
|
||||
|
@ -32,4 +32,3 @@ class OdroidXU3LinuxDevice(LinuxDevice):
|
||||
]
|
||||
|
||||
abi = 'armeabi'
|
||||
|
||||
|
@ -55,4 +55,3 @@ logObserver.start()
|
||||
|
||||
def start_logging(level, fmt='%(asctime)s %(levelname)-8s: %(message)s'):
|
||||
logging.basicConfig(level=getattr(logging, level), format=fmt)
|
||||
|
||||
|
@ -196,4 +196,3 @@ class DelayInstrument(Instrument):
|
||||
if self.active_cooling and not self.device.has('active_cooling'):
|
||||
message = 'Your device does not support active cooling. Did you configure it with an approprite module?'
|
||||
raise InstrumentError(message)
|
||||
|
||||
|
@ -58,5 +58,3 @@ class DmesgInstrument(Instrument):
|
||||
def teardown(self, context): # pylint: disable=unused-argument
|
||||
if self.loglevel:
|
||||
self.device.set_sysfile_value(self.loglevel_file, self.old_loglevel, verify=False)
|
||||
|
||||
|
||||
|
@ -144,4 +144,3 @@ class EnergyProbe(Instrument):
|
||||
writer = csv.DictWriter(f, self.attributes)
|
||||
writer.writeheader()
|
||||
writer.writerows(new_data)
|
||||
|
||||
|
@ -123,4 +123,3 @@ class HwmonInstrument(Instrument):
|
||||
except ValueError, e:
|
||||
self.logger.error('Could not collect all {} readings for {}'.format(sensor.kind, sensor.label))
|
||||
self.logger.error('Got: {}'.format(e))
|
||||
|
||||
|
@ -106,4 +106,3 @@ class JunoEnergy(Instrument):
|
||||
if self.device.name.lower() != 'juno':
|
||||
message = 'juno_energy instrument is only supported on juno devices; found {}'
|
||||
raise InstrumentError(message.format(self.device.name))
|
||||
|
||||
|
@ -189,4 +189,3 @@ class NetstatsInstrument(Instrument):
|
||||
def finalize(self, context):
|
||||
if self.uninstall_on_completion:
|
||||
self.collector.teardown()
|
||||
|
||||
|
@ -118,4 +118,3 @@ class FilePoller(Instrument):
|
||||
label_parts.append(pp[-1]) # always use file name even if same for all
|
||||
labels.append('-'.join(label_parts))
|
||||
return labels
|
||||
|
||||
|
@ -77,4 +77,3 @@ class ScreenOnInstrument(Instrument):
|
||||
def teardown(self, context):
|
||||
if self.polling_period:
|
||||
self.monitor.stop()
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -114,4 +114,3 @@ class Cpuidle(Module):
|
||||
def _on_device_init(self, context): # pylint: disable=unused-argument
|
||||
if not self.device.file_exists(self.root_path):
|
||||
raise DeviceError('Device kernel does not appear to have cpuidle enabled.')
|
||||
|
||||
|
@ -245,4 +245,3 @@ def validate_image_bundle(bundle):
|
||||
except KeyError:
|
||||
msg = 'Tarball {} does not appear to be a valid image bundle (did not see config.txt).'
|
||||
raise ConfigError(msg.format(bundle))
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -264,4 +264,3 @@ class CpuStatesProcessor(ResultProcessor):
|
||||
for i, c in enumerate(powerstate_report.core_names)]
|
||||
writer.writerow(headers)
|
||||
writer.writerows(powerstate_rows)
|
||||
|
||||
|
@ -374,4 +374,3 @@ class DVFS(ResultProcessor):
|
||||
for i in range(self.device.number_of_cores * self.multiply_factor):
|
||||
temprow.append("{0:.3f}".format(temp["cpu{}".format(i)][offline_value]))
|
||||
writer.writerow(temprow)
|
||||
|
||||
|
@ -48,4 +48,3 @@ class StatusTxtReporter(ResultProcessor):
|
||||
for ir in result.iteration_results]
|
||||
write_table(status_lines, wfh, align='<<>><')
|
||||
context.add_artifact('run_status_summary', 'status.txt', 'export')
|
||||
|
||||
|
@ -146,5 +146,3 @@ class SyegResult(object):
|
||||
if not match:
|
||||
raise AttributeError(name)
|
||||
return self.runs[int(match.group(1)) - 1]
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -96,4 +96,3 @@ class RuntimeParametersTest(TestCase):
|
||||
def _instantiate(cls, *args, **kwargs):
|
||||
# Needed to get around Extension's __init__ checks
|
||||
return cls(*args, **kwargs)
|
||||
|
||||
|
@ -40,5 +40,3 @@ class InterruptDiffTest(TestCase):
|
||||
with open(expected_result_file) as fh:
|
||||
expected_diff = fh.read()
|
||||
assert_equal(output_diff, expected_diff)
|
||||
|
||||
|
||||
|
@ -48,4 +48,3 @@ class ExtensionLoaderTest(TestCase):
|
||||
assert_equal(len(devices), 1)
|
||||
assert_equal(devices[0].name, 'test-device')
|
||||
assert_equal(len(loader.list_extensions()), 1)
|
||||
|
||||
|
@ -233,4 +233,3 @@ class InstrumentationTest(TestCase):
|
||||
def _instantiate(cls):
|
||||
# Needed to get around Extension's __init__ checks
|
||||
return cls()
|
||||
|
||||
|
@ -88,4 +88,3 @@ class TestTypes(TestCase):
|
||||
assert_equal(arguments('--foo 7 --bar "fizz buzz"'),
|
||||
['--foo', '7', '--bar', 'fizz buzz'])
|
||||
assert_equal(arguments(['test', 42]), ['test', '42'])
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -131,4 +131,3 @@ def _parse_lambda(text):
|
||||
func_text = re.sub(r'\b{}\b'.format(param), 'value', func_text)
|
||||
|
||||
return func_text
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -24,4 +24,3 @@ def init_argument_parser(parser):
|
||||
help='Enable debug mode. Note: this implies --verbose.')
|
||||
parser.add_argument('--version', action='version', version='%(prog)s {}'.format(get_wa_version()))
|
||||
return parser
|
||||
|
||||
|
@ -129,4 +129,3 @@ def _read_line_from_queue(queue, timeout=0, logger=None):
|
||||
if logger and line:
|
||||
logger.debug(line)
|
||||
return line
|
||||
|
||||
|
@ -304,4 +304,3 @@ def get_rst_from_extension(ext):
|
||||
if params_rst:
|
||||
text += underline('parameters', '~') + params_rst
|
||||
return text + '\n'
|
||||
|
||||
|
@ -20,7 +20,7 @@ from distutils.version import StrictVersion as V
|
||||
|
||||
import serial
|
||||
|
||||
# pylint: disable=ungrouped-imports
|
||||
# pylint: disable=ungrouped-imports, wrong-import-position
|
||||
import pexpect
|
||||
if V(pexpect.__version__) < V('4.0.0'):
|
||||
import fdpexpect # pylint: disable=import-error
|
||||
|
@ -90,4 +90,3 @@ def _get_terminal_size_linux():
|
||||
if __name__ == "__main__":
|
||||
sizex, sizey = get_terminal_size()
|
||||
print 'width =', sizex, 'height =', sizey
|
||||
|
||||
|
@ -286,4 +286,3 @@ class TraceCmdTrace(object):
|
||||
else:
|
||||
if self.filter_markers and inside_marked_region:
|
||||
logger.warning('Did not encounter a stop marker in trace')
|
||||
|
||||
|
@ -231,5 +231,3 @@ class UefiMenu(object):
|
||||
self.options = {}
|
||||
self.prompt = None
|
||||
self.empty_buffer()
|
||||
|
||||
|
||||
|
@ -12,5 +12,3 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
|
@ -92,4 +92,3 @@ class Andebench(AndroidUiAutoBenchmark):
|
||||
results[data['key']] = data['value']
|
||||
for key, value in results.iteritems():
|
||||
context.result.add_metric(key, value)
|
||||
|
||||
|
@ -27,4 +27,3 @@ class AngryBirds(GameWorkload):
|
||||
"""
|
||||
package = 'com.rovio.angrybirds'
|
||||
activity = 'com.rovio.ka3d.App'
|
||||
|
||||
|
@ -27,4 +27,3 @@ class AngryBirdsRio(GameWorkload):
|
||||
"""
|
||||
package = 'com.rovio.angrybirdsrio'
|
||||
activity = 'com.rovio.ka3d.App'
|
||||
|
||||
|
@ -60,4 +60,3 @@ class Anomaly2(GameWorkload):
|
||||
|
||||
def teardown(self, context):
|
||||
self.device.execute('am force-stop {}'.format(self.package))
|
||||
|
||||
|
@ -100,4 +100,3 @@ class Audio(Workload):
|
||||
def _download_audio_file(self):
|
||||
self.logger.debug('Downloading audio file from {}'.format(DEFAULT_AUDIO_FILE_URL))
|
||||
urllib.urlretrieve(DEFAULT_AUDIO_FILE_URL, self.audio_file)
|
||||
|
||||
|
@ -105,4 +105,3 @@ class ChromeAutotest(Workload):
|
||||
parts = [self.test_that, self.device.host, self.test]
|
||||
parts.append(str(self.test_that_args))
|
||||
return ' '.join(parts)
|
||||
|
||||
|
@ -71,7 +71,7 @@ class Camerarecord(UiAutomatorWorkload):
|
||||
# Collect framestats
|
||||
framestats_file = self.device.path.join(self.device.working_directory,
|
||||
'framestats.txt')
|
||||
self.device.execute('dumpsys gfxinfo {} > {}'\
|
||||
self.device.execute('dumpsys gfxinfo {} > {}'
|
||||
.format(self.package, framestats_file))
|
||||
self.device.pull_file(framestats_file,
|
||||
context.output_directory,
|
||||
|
@ -27,4 +27,3 @@ class CastleMaster(GameWorkload):
|
||||
package = 'com.alphacloud.castlemaster'
|
||||
activity = 'com.unity3d.player.UnityPlayerActivity'
|
||||
install_timeout = 500
|
||||
|
||||
|
@ -68,5 +68,3 @@ class Cfbench(AndroidUiAutoBenchmark):
|
||||
else:
|
||||
value = int(child.text)
|
||||
context.result.add_metric(child.attrib['name'], value)
|
||||
|
||||
|
||||
|
@ -155,4 +155,3 @@ class Glb(AndroidUiAutoBenchmark):
|
||||
metric = metric + '_' + str(match_count // 2)
|
||||
context.result.add_metric(metric, value, units)
|
||||
match_count += 1
|
||||
|
||||
|
@ -35,5 +35,3 @@ class GoogleMap(GameWorkload):
|
||||
package = 'com.google.android.apps.maps'
|
||||
activity = 'com.google.android.maps.MapsActivity'
|
||||
loading_time = 20
|
||||
|
||||
|
||||
|
@ -39,4 +39,3 @@ class GunBros(GameWorkload):
|
||||
ondevice_asset_root = '/data'
|
||||
loading_time = 20
|
||||
install_timeout = 500
|
||||
|
||||
|
@ -63,4 +63,3 @@ class Nenamark(AndroidBenchmark):
|
||||
score = match.group(1)
|
||||
context.result.add_metric('nenamark score', score)
|
||||
break
|
||||
|
||||
|
@ -119,4 +119,3 @@ class PowerLoadtest(Workload):
|
||||
parts.append('-b {}'.format(self.board))
|
||||
parts.append(str(self.test_that_args))
|
||||
return ' '.join(parts)
|
||||
|
||||
|
@ -109,4 +109,3 @@ class Quadrant(AndroidUiAutoBenchmark):
|
||||
TYPE_UNITS[test_type])
|
||||
context.result.add_metric(data['metric'] + '_score', data['score'])
|
||||
break
|
||||
|
||||
|
@ -31,5 +31,3 @@ class RealRacing3(GameWorkload):
|
||||
loading_time = 90
|
||||
asset_file = 'com.ea.games.r3_row.tar.gz'
|
||||
saved_state_file = 'rr3-save.tar.gz'
|
||||
|
||||
|
||||
|
@ -45,4 +45,3 @@ class Sqlite(AndroidUiAutoBenchmark):
|
||||
except ValueError:
|
||||
self.logger.warn("Reported results do not match expected format (seconds)")
|
||||
context.result.add_metric(metric, value, 'Seconds', lower_is_better=True)
|
||||
|
||||
|
@ -43,4 +43,3 @@ class TheChase(ApkWorkload):
|
||||
|
||||
def run(self, context):
|
||||
time.sleep(self.duration)
|
||||
|
||||
|
@ -233,4 +233,3 @@ class VellamoResultParser(HTMLParser):
|
||||
self.benchmarks[-1].add_metric(data)
|
||||
else:
|
||||
self.failed = True
|
||||
|
||||
|
@ -135,4 +135,3 @@ class VideoWorkload(Workload):
|
||||
for resolution in self.parameters['resolution'].allowed_values:
|
||||
if resolution in filename:
|
||||
self.video_files[resolution].append(os.path.join(self.video_directory, filename))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user