summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorAdrian Moreno <amorenoz@redhat.com>2022-07-08 20:03:00 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-07-15 17:40:36 +0200
commit12bc968e2633d97b2977f3e158b0c6da0f97670c (patch)
tree073c84c0ea7fc2fc7c058d4cf0cbe8b15aa55b56 /Makefile.am
parent02341a187993c112d82aaee8f510a6dcbc7b943b (diff)
downloadopenvswitch-12bc968e2633d97b2977f3e158b0c6da0f97670c.tar.gz
python: Add generic Key-Value parser.
Most of ofproto and dpif flows are based on key-value pairs. These key-value pairs can be represented in several ways, eg: key:value, key=value, key(value). Add the following classes that allow parsing of key-value strings: * KeyValue: holds a key-value pair * KeyMetadata: holds some metadata associated with a KeyValue such as the original key and value strings and their position in the global string * KVParser: is able to parse a string and extract it's key-value pairs as KeyValue instances. Before creating the KeyValue instance it tries to decode the value via the KVDecoders * KVDecoders holds a number of decoders that KVParser can use to decode key-value pairs. It accepts a dictionary of keys and callables to allow users to specify what decoder (i.e: callable) to use for each key Also, flake8 seems to be incorrectly reporting an error (E203) in: "slice[index + offset : index + offset]" which is PEP8 compliant. So, ignore this error. Acked-by: Terry Wilson <twilson@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index fff98564a..6cf4e27d7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -387,6 +387,7 @@ ALL_LOCAL += flake8-check
# E128 continuation line under-indented for visual indent
# E129 visually indented line with same indent as next logical line
# E131 continuation line unaligned for hanging indent
+# E203 whitespace before ':'
# E722 do not use bare except, specify exception instead
# W503 line break before binary operator
# W504 line break after binary operator
@@ -399,7 +400,7 @@ ALL_LOCAL += flake8-check
# H233 Python 3.x incompatible use of print operator
# H238 old style class declaration, use new style (inherit from `object`)
FLAKE8_SELECT = H231,H232,H233,H238
-FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E722,W503,W504,F811,D,H,I
+FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E203,E722,W503,W504,F811,D,H,I
flake8-check: $(FLAKE8_PYFILES)
$(FLAKE8_WERROR)$(AM_V_GEN) \
src='$^' && \