t.p.deprecate : module documentation

Part of twisted.python View Source

Deprecation framework for Twisted.

To mark a method or function as being deprecated do this:
   def badAPI(self, first, second):
       '''
       Docstring for badAPI.
       '''
       ...
   badAPI = deprecate(Version("Twisted", 8, 0, 0))(badAPI)

The newly-decorated badAPI will issue a warning when called. It will also have a deprecation notice appended to its docstring.

See also Version.
Function getWarningMethod Return the warning method currently used to record deprecation warnings.
Function setWarningMethod Set the warning method to use to record deprecation warnings.
Function getDeprecationWarningString Return a string indicating that the callable was deprecated in the given version.
Function deprecated Return a decorator that marks callables as deprecated.
Function _getDeprecationDocstring Undocumented
Function _appendToDocstring Append the given text to the docstring of thingWithDoc.
def getWarningMethod(): (source)
Return the warning method currently used to record deprecation warnings.
def setWarningMethod(newMethod): (source)

Set the warning method to use to record deprecation warnings.

The callable should take message, category and stacklevel. The return value is ignored.
def _getDeprecationDocstring(version): (source)
Undocumented
def getDeprecationWarningString(callableThing, version): (source)
Return a string indicating that the callable was deprecated in the given version.
ParameterscallableThingA callable to be deprecated.
versionThe twisted.python.versions.Version that the callable was deprecated in.
ReturnsA string describing the deprecation.
def deprecated(version): (source)
Return a decorator that marks callables as deprecated.
def _appendToDocstring(thingWithDoc, textToAppend): (source)

Append the given text to the docstring of thingWithDoc.

If thingWithDoc has no docstring, then the text just replaces the docstring. If it has a single-line docstring then it appends a blank line and the message text. If it has a multi-line docstring, then in appends a blank line a the message text, and also does the indentation correctly.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.