mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-01 19:02:31 +01:00
Updated pylint for v1.5.1
Fixed WA for the latest version of pylint (1.5.1)
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#
|
||||
|
||||
|
||||
# pylint: disable=E1101,E1103
|
||||
# pylint: disable=E1101,E1103,wrong-import-position
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
@@ -59,7 +59,7 @@ class DeviceConfiguration(Serializable):
|
||||
def validate(self):
|
||||
if not self.number_of_ports:
|
||||
raise ConfigurationError('No resistor values were specified.')
|
||||
if not len(self.resistor_values) == len(self.labels):
|
||||
if len(self.resistor_values) != len(self.labels):
|
||||
message = 'The number of resistors ({}) does not match the number of labels ({})'
|
||||
raise ConfigurationError(message.format(len(self.resistor_values), len(self.labels)))
|
||||
|
||||
@@ -151,4 +151,3 @@ def get_config_parser(server=True, device=True):
|
||||
parser.add_argument('--host', action=UpdateServerConfig)
|
||||
parser.add_argument('--port', action=UpdateServerConfig, type=int)
|
||||
return parser
|
||||
|
||||
|
@@ -42,7 +42,7 @@ Port 0
|
||||
:sampling_rate: The rate at which DAQ takes a sample from each channel.
|
||||
|
||||
"""
|
||||
# pylint: disable=F0401,E1101,W0621,no-name-in-module
|
||||
# pylint: disable=F0401,E1101,W0621,no-name-in-module,wrong-import-position,wrong-import-order
|
||||
import os
|
||||
import sys
|
||||
import csv
|
||||
@@ -302,7 +302,7 @@ class DaqRunner(object):
|
||||
if callbacks_supported:
|
||||
self.task = ReadSamplesCallbackTask(config, self.processor)
|
||||
else:
|
||||
self.task = ReadSamplesThreadedTask(config, self.processor)
|
||||
self.task = ReadSamplesThreadedTask(config, self.processor) # pylint: disable=redefined-variable-type
|
||||
self.is_running = False
|
||||
|
||||
def start(self):
|
||||
@@ -334,7 +334,7 @@ if __name__ == '__main__':
|
||||
resistor_values = [0.005]
|
||||
labels = ['PORT_0']
|
||||
dev_config = DeviceConfig('Dev1', channel_map, resistor_values, 2.5, 0.2, 10000, len(resistor_values), labels)
|
||||
if not len(sys.argv) == 3:
|
||||
if len(sys.argv) != 3:
|
||||
print 'Usage: {} OUTDIR DURATION'.format(os.path.basename(__file__))
|
||||
sys.exit(1)
|
||||
output_directory = sys.argv[1]
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#
|
||||
|
||||
|
||||
# pylint: disable=E1101,W0613
|
||||
# pylint: disable=E1101,W0613,wrong-import-position
|
||||
from __future__ import division
|
||||
import os
|
||||
import sys
|
||||
@@ -30,12 +30,12 @@ from twisted.internet.protocol import Factory, Protocol
|
||||
from twisted.internet import reactor, interfaces
|
||||
from twisted.internet.error import ConnectionLost, ConnectionDone
|
||||
|
||||
|
||||
if __name__ == "__main__": # for debugging
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||
from daqpower import log
|
||||
from daqpower.config import DeviceConfiguration
|
||||
from daqpower.common import DaqServerRequest, DaqServerResponse, Status
|
||||
|
||||
try:
|
||||
from daqpower.daq import DaqRunner, list_available_devices, CAN_ENUMERATE_DEVICES
|
||||
__import_error = None
|
||||
@@ -66,7 +66,7 @@ class DummyDaqRunner(object):
|
||||
self.is_running = False
|
||||
|
||||
def start(self):
|
||||
import csv, random
|
||||
import csv, random # pylint: disable=multiple-imports
|
||||
log.info('runner started')
|
||||
for i in xrange(self.config.number_of_ports):
|
||||
rows = [['power', 'voltage']] + [[random.gauss(1.0, 1.0), random.gauss(1.0, 0.1)]
|
||||
|
Reference in New Issue
Block a user