[Zope-CMF] Re: Better DeprecationWarnings

yuppie y.2005- at wcm-solutions.de
Wed Oct 19 10:34:49 EDT 2005


Tres Seaver wrote:
> I'd like to add a DeprecationWarning in manage_addCMFSite,
> which is the entry point which drives PortalGenerator.  I plan to write
> it as::
> 
>  def manage_addCMFSite(self, id, title='Portal', description='',
>                        create_userfolder=1,
>                        email_from_address='postmaster at localhost',
>                        email_from_name='Portal Administrator',
>                        validate_email=0, default_charset='',
>                        RESPONSE=None):
>      """ Adds a portal instance.
>      """
>      from warnings import warn
> 
>      warn("manage_addCMFSite is a deprecated way to create a CMF site; "
>           "in the "
>           "future, please use CMFSetup's 'Configured CMF Site' (from "
>           "the ZMI "
>           "add menu) or 'CMFSetup.factory.addConfiguredSite' (from "
>           "Python).  "

Well. CMFSetup.factory.addConfiguredSite itself is deprecated because on 
the trunk the factory was moved to CMFDefault.

Cheers, Yuppie



More information about the Zope-CMF mailing list