As we're now using an index file with a glob, there's no need to generate index files anymore. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> --- tools/net/ynl/pyynl/netlink_yml_parser.py | 26 ----------------------- tools/net/ynl/pyynl/ynl_gen_rst.py | 17 --------------- 2 files changed, 43 deletions(-) diff --git a/tools/net/ynl/pyynl/netlink_yml_parser.py b/tools/net/ynl/pyynl/netlink_yml_parser.py index f71360f0ceb7..866551726723 100755 --- a/tools/net/ynl/pyynl/netlink_yml_parser.py +++ b/tools/net/ynl/pyynl/netlink_yml_parser.py @@ -358,29 +358,3 @@ class YnlDocGenerator: content = self.parse_yaml(yaml_data) return content - - def generate_main_index_rst(self, output: str, index_dir: str) -> None: - """Generate the `networking_spec/index` content and write to the file""" - lines = [] - - lines.append(self.fmt.rst_header()) - lines.append(self.fmt.rst_label("specs")) - lines.append(self.fmt.rst_title("Netlink Family Specifications")) - lines.append(self.fmt.rst_toctree(1)) - - index_fname = os.path.basename(output) - base, ext = os.path.splitext(index_fname) - - if not index_dir: - index_dir = os.path.dirname(output) - - logging.debug(f"Looking for {ext} files in %s", index_dir) - for filename in sorted(os.listdir(index_dir)): - if not filename.endswith(ext) or filename == index_fname: - continue - base, ext = os.path.splitext(filename) - lines.append(f" {base}\n") - - logging.debug("Writing an index file at %s", output) - - return "".join(lines) diff --git a/tools/net/ynl/pyynl/ynl_gen_rst.py b/tools/net/ynl/pyynl/ynl_gen_rst.py index 5d29ce01c60c..9e756d3c403d 100755 --- a/tools/net/ynl/pyynl/ynl_gen_rst.py +++ b/tools/net/ynl/pyynl/ynl_gen_rst.py @@ -32,13 +32,9 @@ def parse_arguments() -> argparse.Namespace: parser.add_argument("-v", "--verbose", action="store_true") parser.add_argument("-o", "--output", help="Output file name") - parser.add_argument("-d", "--input_dir", help="YAML input directory") # Index and input are mutually exclusive group = parser.add_mutually_exclusive_group() - group.add_argument( - "-x", "--index", action="store_true", help="Generate the index page" - ) group.add_argument("-i", "--input", help="YAML file name") args = parser.parse_args() @@ -71,15 +67,6 @@ def write_to_rstfile(content: str, filename: str) -> None: rst_file.write(content) -def write_index_rst(parser: YnlDocGenerator, output: str, index_dir: str) -> None: - """Generate the `networking_spec/index` content and write to the file""" - - msg = parser.generate_main_index_rst(output, index_dir) - - logging.debug("Writing an index file at %s", output) - write_to_rstfile(msg, output) - - def main() -> None: """Main function that reads the YAML files and generates the RST files""" @@ -98,10 +85,6 @@ def main() -> None: write_to_rstfile(content, args.output) - if args.index: - # Generate the index RST file - write_index_rst(parser, args.output, args.input_dir) - if __name__ == "__main__": main() -- 2.49.0