From 4e4480e89c47b52b3f4fbc1ddf07a7ce541f0839 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Mon, 30 Jan 2023 18:33:42 -0800 Subject: [PATCH] tools: ynl: move the cli and netlink code around Move the CLI code out of samples/ and the library part of it into tools/net/ynl/lib/. This way we can start sharing some code with the code gen. Initially I thought that code gen is too C-specific to share anything but basic stuff like calculating values for enums can easily be shared. Signed-off-by: Jakub Kicinski --- tools/net/ynl/{samples => }/cli.py | 2 +- tools/net/ynl/lib/__init__.py | 5 +++++ tools/net/ynl/{samples => lib}/ynl.py | 0 3 files changed, 6 insertions(+), 1 deletion(-) rename tools/net/ynl/{samples => }/cli.py (97%) create mode 100644 tools/net/ynl/lib/__init__.py rename tools/net/ynl/{samples => lib}/ynl.py (100%) diff --git a/tools/net/ynl/samples/cli.py b/tools/net/ynl/cli.py similarity index 97% rename from tools/net/ynl/samples/cli.py rename to tools/net/ynl/cli.py index b27159c707100..5c4eb5a685148 100755 --- a/tools/net/ynl/samples/cli.py +++ b/tools/net/ynl/cli.py @@ -6,7 +6,7 @@ import json import pprint import time -from ynl import YnlFamily +from lib import YnlFamily def main(): diff --git a/tools/net/ynl/lib/__init__.py b/tools/net/ynl/lib/__init__.py new file mode 100644 index 0000000000000..0a6102758ebe5 --- /dev/null +++ b/tools/net/ynl/lib/__init__.py @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause + +from .ynl import YnlFamily + +__all__ = ["YnlFamily"] diff --git a/tools/net/ynl/samples/ynl.py b/tools/net/ynl/lib/ynl.py similarity index 100% rename from tools/net/ynl/samples/ynl.py rename to tools/net/ynl/lib/ynl.py -- 2.30.2