Fixing py lint errors
Bug: webrtc:9548 Change-Id: I0daf8dc06fdaac1637c32994ef6ad542ed52202a Reviewed-on: https://webrtc-review.googlesource.com/90045 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24068}
This commit is contained in:
@ -66,9 +66,9 @@ def ParseAnaDump(dump_file_to_parse):
|
|||||||
first_time_stamp = None
|
first_time_stamp = None
|
||||||
while True:
|
while True:
|
||||||
event = GetNextMessageFromFile(file_to_parse)
|
event = GetNextMessageFromFile(file_to_parse)
|
||||||
if event == None:
|
if event is None:
|
||||||
break
|
break
|
||||||
if first_time_stamp == None:
|
if first_time_stamp is None:
|
||||||
first_time_stamp = event.timestamp
|
first_time_stamp = event.timestamp
|
||||||
if event.type == debug_dump_pb2.Event.ENCODER_RUNTIME_CONFIG:
|
if event.type == debug_dump_pb2.Event.ENCODER_RUNTIME_CONFIG:
|
||||||
for decision in event.encoder_runtime_config.DESCRIPTOR.fields:
|
for decision in event.encoder_runtime_config.DESCRIPTOR.fields:
|
||||||
@ -110,7 +110,7 @@ def main():
|
|||||||
action='append')
|
action='append')
|
||||||
|
|
||||||
options = parser.parse_args()[0]
|
options = parser.parse_args()[0]
|
||||||
if options.dump_file_to_parse == None:
|
if options.dump_file_to_parse is None:
|
||||||
print "No dump file to parse is set.\n"
|
print "No dump file to parse is set.\n"
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
exit()
|
exit()
|
||||||
|
@ -61,7 +61,7 @@ class InputSignalCreator(object):
|
|||||||
AudioSegment instance.
|
AudioSegment instance.
|
||||||
"""
|
"""
|
||||||
assert 0 < frequency <= 24000
|
assert 0 < frequency <= 24000
|
||||||
assert 0 < duration
|
assert duration > 0
|
||||||
template = signal_processing.SignalProcessingUtils.GenerateSilence(duration)
|
template = signal_processing.SignalProcessingUtils.GenerateSilence(duration)
|
||||||
return signal_processing.SignalProcessingUtils.GeneratePureTone(
|
return signal_processing.SignalProcessingUtils.GeneratePureTone(
|
||||||
template, frequency)
|
template, frequency)
|
||||||
|
@ -41,7 +41,7 @@ def ParsePlotLine(line):
|
|||||||
# The variable name can contain any non-whitespace character except "#:@"
|
# The variable name can contain any non-whitespace character except "#:@"
|
||||||
match = re.match(r'([^\s#:@]+)(?:#\d)?:(\d+)@(\S+)', annotated_var)
|
match = re.match(r'([^\s#:@]+)(?:#\d)?:(\d+)@(\S+)', annotated_var)
|
||||||
|
|
||||||
if match == None:
|
if match is None:
|
||||||
raise ParsePlotLineException("Could not parse variable name, ssrc and \
|
raise ParsePlotLineException("Could not parse variable name, ssrc and \
|
||||||
algorithm name", annotated_var)
|
algorithm name", annotated_var)
|
||||||
var_name = match.group(1)
|
var_name = match.group(1)
|
||||||
|
@ -237,7 +237,7 @@ class CheckNoMixingSourcesTest(unittest.TestCase):
|
|||||||
self.assertTrue('bar.c' in str(errors[0]))
|
self.assertTrue('bar.c' in str(errors[0]))
|
||||||
|
|
||||||
def _AssertNumberOfErrorsWithSources(self, number_of_errors, sources):
|
def _AssertNumberOfErrorsWithSources(self, number_of_errors, sources):
|
||||||
assert 3 == len(sources), 'This function accepts a list of 3 source files'
|
assert len(sources) == 3, 'This function accepts a list of 3 source files'
|
||||||
self._GenerateBuildFile(textwrap.dedent("""
|
self._GenerateBuildFile(textwrap.dedent("""
|
||||||
rtc_static_library("bar_foo") {
|
rtc_static_library("bar_foo") {
|
||||||
sources = [
|
sources = [
|
||||||
|
1
pylintrc
1
pylintrc
@ -20,6 +20,7 @@ disable=
|
|||||||
I0010,
|
I0010,
|
||||||
I0011,
|
I0011,
|
||||||
W0232,
|
W0232,
|
||||||
|
C0413,
|
||||||
bad-continuation,
|
bad-continuation,
|
||||||
broad-except,
|
broad-except,
|
||||||
duplicate-code,
|
duplicate-code,
|
||||||
|
@ -161,9 +161,9 @@ def Build(build_dir, arch, use_goma, extra_gn_args, extra_gn_switches,
|
|||||||
gn_args_str = '--args=' + ' '.join([
|
gn_args_str = '--args=' + ' '.join([
|
||||||
k + '=' + _EncodeForGN(v) for k, v in gn_args.items()] + extra_gn_args)
|
k + '=' + _EncodeForGN(v) for k, v in gn_args.items()] + extra_gn_args)
|
||||||
|
|
||||||
gn_args = ['gen', output_directory, gn_args_str]
|
gn_args_list = ['gen', output_directory, gn_args_str]
|
||||||
gn_args.extend(extra_gn_switches)
|
gn_args_list.extend(extra_gn_switches)
|
||||||
_RunGN(gn_args)
|
_RunGN(gn_args_list)
|
||||||
|
|
||||||
ninja_args = TARGETS[:]
|
ninja_args = TARGETS[:]
|
||||||
if use_goma:
|
if use_goma:
|
||||||
|
@ -61,7 +61,7 @@ def main():
|
|||||||
snapshots = []
|
snapshots = []
|
||||||
while True:
|
while True:
|
||||||
snapshot = GrabCpuSamples(sample_count)
|
snapshot = GrabCpuSamples(sample_count)
|
||||||
if snapshot == None:
|
if snapshot is None:
|
||||||
break
|
break
|
||||||
snapshots.append(snapshot)
|
snapshots.append(snapshot)
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ SRC = os.path.abspath(os.path.join(
|
|||||||
os.path.dirname((__file__)), os.pardir, os.pardir))
|
os.path.dirname((__file__)), os.pardir, os.pardir))
|
||||||
sys.path.append(os.path.join(SRC, 'third_party', 'pymock'))
|
sys.path.append(os.path.join(SRC, 'third_party', 'pymock'))
|
||||||
|
|
||||||
import mock
|
|
||||||
import unittest
|
import unittest
|
||||||
|
import mock
|
||||||
|
|
||||||
from generate_licenses import LicenseBuilder
|
from generate_licenses import LicenseBuilder
|
||||||
|
|
||||||
|
@ -196,9 +196,9 @@ def AverageOverCycle(values, length):
|
|||||||
|
|
||||||
total = [0.0] * length
|
total = [0.0] * length
|
||||||
count = [0] * length
|
count = [0] * length
|
||||||
for k in range(len(values)):
|
for k, val in enumerate(values):
|
||||||
if values[k] is not None:
|
if val is not None:
|
||||||
total[k % length] += values[k]
|
total[k % length] += val
|
||||||
count[k % length] += 1
|
count[k % length] += 1
|
||||||
|
|
||||||
result = [0.0] * length
|
result = [0.0] * length
|
||||||
@ -386,11 +386,11 @@ def PlotConfigsFromArgs(args):
|
|||||||
# argparse.ArgumentParser, modified to remember the order of arguments.
|
# argparse.ArgumentParser, modified to remember the order of arguments.
|
||||||
# Then we traverse the argument list and fill the PlotConfig.
|
# Then we traverse the argument list and fill the PlotConfig.
|
||||||
args = itertools.groupby(args, lambda x: x in ["-n", "--next"])
|
args = itertools.groupby(args, lambda x: x in ["-n", "--next"])
|
||||||
args = list(list(group) for match, group in args if not match)
|
prep_args = list(list(group) for match, group in args if not match)
|
||||||
|
|
||||||
parser = GetParser()
|
parser = GetParser()
|
||||||
plot_configs = []
|
plot_configs = []
|
||||||
for index, raw_args in enumerate(args):
|
for index, raw_args in enumerate(prep_args):
|
||||||
graph_args = parser.parse_args(raw_args).ordered_args
|
graph_args = parser.parse_args(raw_args).ordered_args
|
||||||
plot_configs.append(_PlotConfigFromArgs(graph_args, index))
|
plot_configs.append(_PlotConfigFromArgs(graph_args, index))
|
||||||
return plot_configs
|
return plot_configs
|
||||||
|
Reference in New Issue
Block a user