Current Path : /usr/lib/python2.7/dist-packages/twisted/python/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/python/deprecate.pyc |
6Nc @ sU d Z d d d d d g Z d d l Z d d l Z d d l m a m Z d d l m Z d d l m Z d d l m Z d Z d Z d e _ d e _ d Z d Z d d Z d Z d d d Z d d d Z d d Z d Z d e f d YZ d e f d YZ d e f d YZ d Z d Z d Z d S(! s Deprecation framework for Twisted. To mark a method or function as being deprecated do this:: from twisted.python.versions import Version from twisted.python.deprecate import deprecated @deprecated(Version("Twisted", 8, 0, 0)) def badAPI(self, first, second): ''' Docstring for badAPI. ''' ... The newly-decorated badAPI will issue a warning when called. It will also have a deprecation notice appended to its docstring. To mark module-level attributes as being deprecated you can use:: badAttribute = "someValue" ... deprecatedModuleAttribute( Version("Twisted", 8, 0, 0), "Use goodAttribute instead.", "your.full.module.name", "badAttribute") The deprecated attributes will issue a warning whenever they are accessed. If the attributes being deprecated are in the same module as the L{deprecatedModuleAttribute} call is being made from, the C{__name__} global can be used as the C{moduleName} parameter. See also L{Version}. @type DEPRECATION_WARNING_FORMAT: C{str} @var DEPRECATION_WARNING_FORMAT: The default deprecation warning string format to use when one is not provided by the user. t deprecatedt getDeprecationWarningStringt getWarningMethodt setWarningMethodt deprecatedModuleAttributeiN( t warnt warn_explicit( t findlinestarts( t getVersionString( t mergeFunctionMetadatas&