* Refactored the file I/O model throughout, to support multiple
processing paths. PEP source text is now read into a list of lines.
* In ``fixfile()``:
- Updated its parameters for the new I/O model.
- Changed ``fo`` to ``outfile``, ``fi`` to ``inpath`` and
``input_lines``.
- Input is read in by iterating over the list of input lines, rather
than using "readlines()".
- Opening and closing of files is done by the caller, "make_html()".
- Added PEP number processing in Requires header.
- Linked "Content-Type: text/plain" to PEP 9.
* Added ``fix_rst_pep()``, which imports and calls Docutils code.
* Added ``get_pep_type()``, which checks for a Content-Type header and
returns the value, defaulting to "text/plain". If no PEP header is
found, ``None`` is returned: input is not a PEP.
* Added ``get_input_lines()`` to read input file into a list.
* Expanded ``make_html()`` to catch errors and process the different
PEP formats via the new ``PEP_TYPE_DISPATCH`` dict.
* Added ``check_requirements()`` to check both Python and Docutils
requirements. ``pep_type_error()`` is called if the required
software is not available.
* In ``main()``:
- Added an ``argv`` parameter, so that pep2html.py can be imported
and command-line options passed in. Yes, I use this functionality
in the Docutils "buildhtml.py" front end.
- Files skipped (due to an error) are not pushed onto the server.
New Meta-PEP, "Sample reStructuredText PEP Template"
====================================================
* I've presumed to use "PEP 12", as the next available Meta-PEP
number; I'll change it if I'm mistaken. (Barry: PEP 12 was agreed
on as fine).
* Its status is "Draft". If acceptable as-is, please change the
Status header to "Active". (Barry: Done)
* I've listed Barry as co-author. Since much of the text was copied
from PEP 9, I figure it's only fair. (Barry: thanks!)
* This PEP is marked up using reStructuredText, naturally.
* The "Abstract", "Rationale", and "How to Use This Template" sections
are based on PEP 9. "Abstract" has a reference back to PEP 9.
"Rationale" contains a one-paragraph rationale for reStructuredText
PEPs. "How to Use This Template" has been marked up a bit.
* The "ReStructuredText PEP Formatting Requirements" section is the
big difference. Subsection "General" contains the same text-level
instructions as in PEP 9: two spaces at sentence end; 70 columns; no
tabs; Emacs stanza. The rest of the section describes the
reStructuredText syntax and PEP-specific conventions.
* Changed name from "Sample PEP Template" to "Sample Plaintext PEP
Template", and edited throughout to differentiate the choices:
- Added "plaintext" where appropriate to make the context clear.
- "Style" -> "format".
- Referred to PEP 1 as "content guidelines", not "style" guidelines.
* Added a "Content-Type: text/plain" header to be explicit.
* Added a reference to the alternative format available in
reStructuredText PEPs.
* Combined "How to Use This Template for Standard Track PEPs" and "How
to Use This Template for Informational PEPs" into one "How to Use
This Template" section. In addition to the duplication, there were
several errors and inconsistencies between the two source sections.
Conditionals have been added as appropriate.
* Clarified the discussion of the Replaces header as per discussions.
* Added "Plaintext PEP Formatting Requirements", moved from PEP 1's
"PEP Formatting Requirements".
- Removed the paragraph beginning "A PEP must contain a Copyright
section" as redundant; already covered in "How to Use This
Template".
- Minor edits.
* Minor edits, including:
- Fixed typos.
- Removed colons from header field names (e.g., "the Author
header").
(Some additional minor edits by Barry).
* Changed the "PEP Template" section to "PEP Formats and Templates",
in which plaintext and reStructuredText PEPs are described.
* Added "PEP Header Preamble" heading, for the RFC 2822 header
description.
- Rearranged some descriptions to match the header order.
- Removed the colons from header field names (e.g., "the Author
header").
- Added a description of the Content-Type header.
* Moved the plaintext-PEP-specific "PEP Formatting Requirements"
section to PEP 9. PEP 1 now deals only with content, not format.
* Minor edits, including:
- Capitalized "Standards Track" and "Informational" throughout.
- In "it's not like such decisions can be reversed", "can" should be
"can't"; fixed.
Mention %X (same treatment as %x).
Insert new stage B0, which gives warnings about e.g. 0xffffffff
without semantic changes. Move the proposed deployment of subsequent
stages up by one minor revision.
Retrieving a buffer from an object puts this in a locked state, and a
releasebuffer function must be called to unlock the object again.
Added releasefixedbuffer function slot, and renamed the
get...fixedbuffer functions to acquire...fixedbuffer functions.
Renamed the flag from Py_TPFLAG_HAVE_GETFIXEDBUFFER to
Py_TPFLAG_HAVE_FIXEDBUFFER. (Is the 'fixed buffer' name still useful,
or should we use 'static buffer' instead?)
Added posting date (was posted to c.l.p and python-dev).