1
0
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:
Sebastian Goscik
2015-12-09 15:43:35 +00:00
parent 344bc519c4
commit bef8fb40ef
35 changed files with 86 additions and 102 deletions

View File

@@ -222,11 +222,7 @@ def poll_for_file(device, dfile):
command = "adb " + device_string + " shell \" if [ -f " + dfile + " ] ; then true ; else false ; fi\" "
logger.debug(command)
result = subprocess.call(command, stderr=subprocess.PIPE, shell=True)
if not result:
return True
else:
return False
return not bool(result)
am_start_error = re.compile(r"Error: Activity class {[\w|.|/]*} does not exist")

View File

@@ -18,6 +18,7 @@ import os
import subprocess
from distutils.version import StrictVersion
# pylint: disable=wrong-import-position
import_error_str = ''
try:
import IPython
@@ -28,7 +29,7 @@ except ImportError as import_error:
if import_error.message.startswith("No module named"): # pylint: disable=E1101
import_error_str = 'ipynb_exporter requires ipython package to be installed'
else:
import_error_str = import_error.message
import_error_str = import_error.message # pylint: disable=redefined-variable-type
# The current code generates notebooks version 3
NBFORMAT_VERSION = 3

View File

@@ -250,7 +250,7 @@ def get_traceback(exc=None):
def merge_dicts(*args, **kwargs):
if not len(args) >= 2:
if len(args) < 2:
raise ValueError('Must specify at least two dicts to merge.')
func = partial(_merge_two_dicts, **kwargs)
return reduce(func, args)
@@ -314,7 +314,7 @@ def _merge_two_dicts(base, other, list_duplicates='all', match_types=False, # p
def merge_lists(*args, **kwargs):
if not len(args) >= 2:
if len(args) < 2:
raise ValueError('Must specify at least two lists to merge.')
func = partial(_merge_two_lists, **kwargs)
return reduce(func, args)
@@ -696,7 +696,7 @@ def load_struct_from_python(filepath=None, text=None):
for k, v in mod.__dict__.iteritems()
if not k.startswith('_'))
except SyntaxError as e:
raise LoadSyntaxError(e.message, e.filepath, e.lineno)
raise LoadSyntaxError(e.message, filepath, e.lineno)
def load_struct_from_yaml(filepath=None, text=None):
@@ -713,7 +713,7 @@ def load_struct_from_yaml(filepath=None, text=None):
except yaml.YAMLError as e:
lineno = None
if hasattr(e, 'problem_mark'):
lineno = e.problem_mark.line
lineno = e.problem_mark.line # pylint: disable=no-member
raise LoadSyntaxError(e.message, filepath=filepath, lineno=lineno)

View File

@@ -51,7 +51,7 @@ class KshellConnection(object):
def login(self, user, password):
code, out = self.send_command('login {} {}\r\n'.format(user, password))
if not code == 250:
if code != 250:
raise NetioError('Login failed. Got: {} {}'.format(code, out))
def enable_port(self, port):
@@ -64,7 +64,7 @@ class KshellConnection(object):
def set_port(self, port, value):
code, out = self.send_command('port {} {}'.format(port, value))
if not code == 250:
if code != 250:
raise NetioError('Could not set {} on port {}. Got: {} {}'.format(value, port, code, out))
def send_command(self, command):
@@ -95,4 +95,3 @@ class KshellConnection(object):
def close(self):
self.conn.close()

View File

@@ -19,6 +19,8 @@ from contextlib import contextmanager
from distutils.version import StrictVersion as V
import serial
# pylint: disable=ungrouped-imports
import pexpect
if V(pexpect.__version__) < V('4.0.0'):
import fdpexpect # pylint: disable=import-error
@@ -118,5 +120,3 @@ def open_serial_connection(timeout, get_conn=False, init_dtr=None, *args, **kwar
target.close() # Closes the file descriptor used by the conn.
del conn

View File

@@ -43,7 +43,7 @@ def ssh_get_shell(host, username, password=None, keyfile=None, port=None, timeou
raise ConfigError('keyfile may not be used with a telnet connection.')
conn = TelnetConnection()
else: # ssh
conn = pxssh.pxssh()
conn = pxssh.pxssh() # pylint: disable=redefined-variable-type
try:
if keyfile:
conn.login(host, username, ssh_key=keyfile, port=port, login_timeout=timeout)
@@ -274,4 +274,3 @@ def process_backspaces(text):
else:
chars.append(c)
return ''.join(chars)