t.p._.NewsBuilder(object) : class documentation

Part of twisted.python._release View Source View In Hierarchy

Generate the new section of a NEWS file.

The _FEATURE, _BUGFIX, _DOC, _REMOVAL, and _MISC attributes of this class are symbolic names for the news entry types which are supported. Conveniently, they each also take on the value of the file name extension which indicates a news entry of that type.

Method build Load all of the change information from the given directory and write it out to the given output file.
Method buildAll No summary
Method main Build all news files.
Class Variable _headings A dict mapping one of the news entry types to the heading to write out for that type of news entry.
Class Variable _NO_CHANGES A str giving the text which appears when there are no significant changes in a release.
Class Variable _TICKET_HINT A str giving the text which appears at the top of each news file and which should be kept at the top, not shifted down with all the other content. Put another way, this is the text after which the new news text is inserted.
Method _today Return today's date as a string in YYYY-MM-DD format.
Method _findChanges Load all the feature ticket summaries.
Method _formatHeader Format a header for a NEWS file.
Method _writeHeader Write a version header to the given file.
Method _writeSection Write out one section (features, bug fixes, etc) to the given file.
Method _writeMisc Write out a miscellaneous-changes section to the given file.
Method _deleteFragments Delete the change information, to clean up the repository once the NEWS files have been built. It requires path to be in a SVN directory.
Method _getNewsName Return the name of project that should appear in NEWS.
Method _iterProjects Iterate through the Twisted projects in baseDirectory, yielding everything we need to know to build news for them.
Method _changeNewsVersion Change all references to the current version number in a NEWS file to refer to newVersion instead.
_headings =
A dict mapping one of the news entry types to the heading to write out for that type of news entry.
_NO_CHANGES =
A str giving the text which appears when there are no significant changes in a release.
_TICKET_HINT =
A str giving the text which appears at the top of each news file and which should be kept at the top, not shifted down with all the other content. Put another way, this is the text after which the new news text is inserted.
def _today(self): (source)
Return today's date as a string in YYYY-MM-DD format.
def _findChanges(self, path, ticketType): (source)
Load all the feature ticket summaries.
ParameterspathA FilePath the direct children of which to search for news entries.
ticketTypeThe type of news entries to search for. One of NewsBuilder._FEATURE, NewsBuilder._BUGFIX, NewsBuilder._REMOVAL, or NewsBuilder._MISC.
ReturnsA list of two-tuples. The first element is the ticket number as an int. The second element of each tuple is the description of the feature.
def _formatHeader(self, header): (source)
Format a header for a NEWS file.

A header is a title with '=' signs underlining it.

ParametersheaderThe header string to format. (type: str)
ReturnsA str containing header.
def _writeHeader(self, fileObj, header): (source)
Write a version header to the given file.
ParametersfileObjA file-like object to which to write the header.
headerThe header to write to the file. (type: str)
def _writeSection(self, fileObj, header, tickets): (source)
Write out one section (features, bug fixes, etc) to the given file.
ParametersfileObjA file-like object to which to write the news section.
headerThe header for the section to write. (type: str)
ticketsA list of ticket information of the sort returned by NewsBuilder._findChanges.
def _writeMisc(self, fileObj, header, tickets): (source)
Write out a miscellaneous-changes section to the given file.
ParametersfileObjA file-like object to which to write the news section.
headerThe header for the section to write. (type: str)
ticketsA list of ticket information of the sort returned by NewsBuilder._findChanges.
def build(self, path, output, header): (source)
Load all of the change information from the given directory and write it out to the given output file.
ParameterspathA directory (probably a topfiles directory) containing change information in the form of <ticket>.<change type> files. (type: FilePath)
outputThe NEWS file to which the results will be prepended. (type: FilePath)
headerThe top-level header to use when writing the news. (type: str)
RaisesNotWorkingDirectoryIf the path is not an SVN checkout.
def _deleteFragments(self, path): (source)
Delete the change information, to clean up the repository once the NEWS files have been built. It requires path to be in a SVN directory.
ParameterspathA directory (probably a topfiles directory) containing change information in the form of <ticket>.<change type> files. (type: FilePath)
def _getNewsName(self, project): (source)
Return the name of project that should appear in NEWS.
ParametersprojectA Project
ReturnsThe name of project.
def _iterProjects(self, baseDirectory): (source)
Iterate through the Twisted projects in baseDirectory, yielding everything we need to know to build news for them.

Yields topfiles, name, version, for each sub-project in reverse-alphabetical order. topfile is the FilePath for the topfiles directory, name is the nice name of the project (as should appear in the NEWS file), version is the current version string for that project.

ParametersbaseDirectoryA FilePath representing the root directory beneath which to find Twisted projects for which to generate news (see findTwistedProjects). (type: FilePath)
def buildAll(self, baseDirectory): (source)
Find all of the Twisted subprojects beneath baseDirectory and update their news files from the ticket change description files in their topfiles directories and update the news file in baseDirectory with all of the news.
ParametersbaseDirectoryA FilePath representing the root directory beneath which to find Twisted projects for which to generate news (see findTwistedProjects).
def _changeNewsVersion(self, news, name, oldVersion, newVersion, today): (source)
Change all references to the current version number in a NEWS file to refer to newVersion instead.
ParametersnewsThe NEWS file to change. (type: FilePath)
nameThe name of the project to change. (type: str)
oldVersionThe old version of the project. (type: Version)
newVersionThe new version of the project. (type: Version)
todayA YYYY-MM-DD string representing today's date. (type: str)
def main(self, args): (source)
Build all news files.
ParametersargsThe command line arguments to process. This must contain one string, the path to the base of the Twisted checkout for which to build the news. (type: list of str)
API Documentation for Twisted, generated by pydoctor at 2013-11-08 22:07:30.