-
Notifications
You must be signed in to change notification settings - Fork 655
update generate_pep_pages to support the new PEP 0(rst format) #1192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update generate_pep_pages to support the new PEP 0(rst format) #1192
Conversation
berkerpeksag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mozillazg sorry for my late response. Can you please rebase your branch?
Also, which one should be merged first? This one or the python/peps PR? And since we can't deploy both PRs at the same time, is there a chance that one of them cab break python.org?
peps/converters.py
Outdated
|
|
||
| data['content'] = str(pep_content) | ||
|
|
||
| source_link = "https://github.com/python/peps/blob/master/pep-{0}.txt".format(pep_number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you move this inside get_pep_page() because you called convert_pep_page() in convert_pep0(), right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
7e42c90 to
003006c
Compare
|
@berkerpeksag This one should be merged first. This PR support both the old |
peps/converters.py
Outdated
| pep_ext = '.txt' | ||
| pep_rst_source = os.path.join( | ||
| settings.PEP_REPO_PATH, 'pep-{}.rst'.format(pep_number)) | ||
| if os.path.exists(pep_rst_source): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you've just moved the existing code, it would be nice to use this as an opportunity to simplify the code a bit:
pep_rst_source = ...
pep_ext = '.rst' if os.path.exists(pep_rst_source) else '.txt'|
|
||
| pep_content = convert_pep_page(pep_number, open(pep_path).read()) | ||
| pep_ext = '.txt' | ||
| pep_rst_source = os.path.join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: Can we use hanging indentation here?
pep_rst_source = os.path.join(
settings.PEP_REPO_PATH, 'pep-{}.rst'.format(pep_number),
)
Nice! :) Thank you very much. |
003006c to
993eba8
Compare
|
Preview:
|
|
Thanks! I'll test it again in my dev environment and cherry-pick into the release branch. |
The new PEP 0 pull request can be found at python/peps#463. Conflicts: peps/converters.py
|
Cherry-picked now: 91ba765 Thanks again, @mozillazg! |
The new PEP 0 pull request can be found at python/peps#463.
New PEP 0: python/peps#463
After merged this PR,
generate_pep_pageswill support both oldpep-0000.txtand newpep-0000.rst.