Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit b41c018

Browse files
committed
Move error code table generation from Makefile to conf.py.
1 parent a51bf60 commit b41c018

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ clean:
5050
rm -rf $(BUILDDIR)/*
5151

5252
html:
53-
@echo "Building error code table from error registry."
54-
python -c "import os, sys; sys.path.insert(0, os.path.join(os.getcwd(), '..')); from pep257 import ErrorRegistry; print(ErrorRegistry.to_rst())" > snippets/error_code_table.rst
5553
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
5654
@echo
5755
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,10 @@
265265
# sphinxcontrib.issuetracker settings
266266
issuetracker = 'github'
267267
issuetracker_project = 'GreenSteam/pep257'
268+
269+
def generate_error_code_table():
270+
from ..pep257 import ErrorRegistry
271+
with open(os.path.join('snippets', 'error_code_table.rst'), 'wt') as outf:
272+
outf.write(ErrorRegistry.to_rst())
273+
274+
generate_error_code_table()

0 commit comments

Comments
 (0)