From cc46c77036d3208d717a243e7a97e48609dfaebf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 2 Apr 2019 13:08:51 +0200 Subject: add transition_map accessor --- lib/protocol_benchmarks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/protocol_benchmarks.py b/lib/protocol_benchmarks.py index 133e4b5..2761699 100755 --- a/lib/protocol_benchmarks.py +++ b/lib/protocol_benchmarks.py @@ -84,6 +84,11 @@ class DummyProtocol: self.transition_map[code_snippet.rstrip()] = args return code_snippet + def get_transition_args(self, code_snippet: str) -> list: + if code_snippet in self.transition_map: + return self.transition_map[code_snippet] + return list() + class ArduinoJSON(DummyProtocol): def __init__(self, data, bufsize = 255, int_type = 'uint16_t', float_type = 'float'): @@ -1328,7 +1333,7 @@ def codegen_for_lib(library, library_options, data): raise ValueError('Unsupported library: {}'.format(library)) -def shorten_call(snippet, lib = ''): +def shorten_call(snippet, lib): """ Remove literal arguments and variable names from ProtoBench function calls. -- cgit v1.2.3