summaryrefslogtreecommitdiff
path: root/system/tools/scripts/dump_metrics_ascii.py
diff options
context:
space:
mode:
authorZach Johnson <zachoverflow@google.com>2020-05-18 12:52:26 -0700
committerZach Johnson <zachoverflow@google.com>2020-05-18 12:52:51 -0700
commit764d3b76a687a54dfdf50dfb6925a4ff2e362555 (patch)
tree28894413f273c4a17a0bc8e4de17311489f63845 /system/tools/scripts/dump_metrics_ascii.py
parent5ff3191fa8aba657bbdb1ab2cf46b36e52a518d7 (diff)
Format python files with extended line length now allowed
Bug: 156858180 Test: cert/run --host Tag: #gd-refactor Change-Id: I45ab86f366316246f14b24dd83f66684badf22e0
Diffstat (limited to 'system/tools/scripts/dump_metrics_ascii.py')
-rwxr-xr-xsystem/tools/scripts/dump_metrics_ascii.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/system/tools/scripts/dump_metrics_ascii.py b/system/tools/scripts/dump_metrics_ascii.py
index 20d413285b..0adb278322 100755
--- a/system/tools/scripts/dump_metrics_ascii.py
+++ b/system/tools/scripts/dump_metrics_ascii.py
@@ -33,10 +33,8 @@ def compile_proto(proto_path, output_dir):
if not protoc:
protoc = find_executable('protoc')
if not protoc:
- logging.error(
- "Cannot find Protobuf compiler (>=3.0.0), please install"
- "protobuf-compiler package. Prefer copying from <top>/prebuilts/tools"
- )
+ logging.error("Cannot find Protobuf compiler (>=3.0.0), please install"
+ "protobuf-compiler package. Prefer copying from <top>/prebuilts/tools")
logging.error(" prebuilts/tools/linux-x86_64/protoc/bin/protoc")
logging.error("If prebuilts are not available, use apt-get:")
logging.error(" sudo apt-get install protobuf-compiler")
@@ -54,11 +52,7 @@ def compile_proto(proto_path, output_dir):
input_dir = os.path.dirname(proto_path)
output_filename = os.path.basename(proto_path).replace('.proto', '_pb2.py')
output_path = os.path.join(output_dir, output_filename)
- protoc_command = [
- protoc,
- '-I=%s' % (input_dir),
- '--python_out=%s' % (output_dir), proto_path
- ]
+ protoc_command = [protoc, '-I=%s' % (input_dir), '--python_out=%s' % (output_dir), proto_path]
if subprocess.call(protoc_command, stderr=subprocess.STDOUT) != 0:
logging.error("Fail to compile proto")
return None
@@ -82,8 +76,7 @@ def compile_import_proto(output_dir, proto_path):
try:
output_module = import_module(output_module_name)
except ImportError:
- logging.error(
- "Cannot import generated py-proto %s" % (output_module_name))
+ logging.error("Cannot import generated py-proto %s" % (output_module_name))
return output_module
@@ -130,8 +123,7 @@ def main():
logging.info("Usage: " + sys.argv[0] + " <path_to_metric_proto>")
logging.info("Requires Protobuf compiler, protoc, version >=3.0.0")
sys.exit(0)
- bluetooth_proto_module = compile_import_proto(tempfile.gettempdir(),
- sys.argv[1])
+ bluetooth_proto_module = compile_import_proto(tempfile.gettempdir(), sys.argv[1])
if not bluetooth_proto_module:
logging.error("Cannot compile " + sys.argv[1])
sys.exit(1)