Skip to content

Commit

Permalink
Fixed some file paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Mar 11, 2024
1 parent 6cd2cc9 commit 790aba4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions docs/page.rst.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
{{ metadata.module }}
=================================================
=================================================================================

The original MIB document is,

.. literalinclude:: ../asn1/{{ metadata.module }}
:language: asn1
The original MIB document can be downloaded from `here <https://mibs.pysnmp.com/asn1/{{ metadata.module }}>`_.

Its compiled Python module is,

.. literalinclude:: ../pysnmp/{{ metadata.module }}.py
.. literalinclude:: ../../pysnmp/{{ metadata.module }}.py
:language: python

Its compiled Python module with MIB text is,

.. literalinclude:: ../pysnmp-with-text/{{ metadata.module }}.py
.. literalinclude:: ../../pysnmp-with-texts/{{ metadata.module }}.py
:language: python

Its compiled JSON file is,

.. literalinclude:: ../json/{{ metadata.module }}.json
.. literalinclude:: ../../json/{{ metadata.module }}.json
:language: json
6 changes: 3 additions & 3 deletions docs/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def new_toc(path = "./mibs"):
rst_files = [file for file in rst_files if 'index.rst' not in file]

# Format the filenames for the toctree
rst_file_names = [" " + os.path.splitext(os.path.basename(file))[0] for file in rst_files]
rst_file_names = [" " + os.path.splitext(os.path.basename(file))[0] + "\n" for file in sorted(rst_files)]

# Read the current contents of index.rst
with open("index.rst.txt", 'r') as file:
Expand All @@ -18,11 +18,11 @@ def new_toc(path = "./mibs"):
line_number = next(i for i, line in enumerate(index_content) if '.. toctree::' in line)

# Insert the filenames into the index.rst content
updated_content = index_content[0:line_number+2] + rst_file_names + index_content[line_number+2:]
updated_content = index_content[0:line_number+3] + rst_file_names + index_content[line_number+4:]

# Write the updated content back to index.rst
with open(os.path.join(path, "index.rst"), 'w') as file:
file.write('\n'.join(updated_content))
file.write(''.join(updated_content))

def new_rst_files():
# Get all files in the ..\asn1 directory
Expand Down

0 comments on commit 790aba4

Please sign in to comment.