On 3/11/22 16:21, Adrian Moreno wrote: > 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. > > Signed-off-by: Adrian Moreno <[email protected]> > --- > Makefile.am | 3 +- > python/automake.mk | 6 +- > python/ovs/flows/__init__.py | 0 > python/ovs/flows/decoders.py | 18 ++ > python/ovs/flows/kv.py | 314 +++++++++++++++++++++++++++++++++++ > python/setup.py | 2 +- > 6 files changed, 340 insertions(+), 3 deletions(-) > create mode 100644 python/ovs/flows/__init__.py > create mode 100644 python/ovs/flows/decoders.py > create mode 100644 python/ovs/flows/kv.py
Nit: Can we rename the library to just 'flow' instead of 'flows'? Seems more natural this way. Otherwise, I posted some comments on patches 11-14. If you can address those and post a new version, that would be great. Thanks! Best regards, Ilya Maximets. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
