File:  [Repository] / ExtFile / __init__.py
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jan 24 16:53:50 2007 UTC (17 years, 3 months ago) by dwinter
Branches: first, MAIN
CVS tags: release, HEAD
Auf der Basis http://www.zope.org/Members/shh/ExtFile Version 1.5.4

mit zlog ersetzt durch logging


__doc__ = """ExtFile initialization module. """
__version__ = '1.5.4'

def initialize(context): 
    """Initialize the ExtFile product."""
    
    import ExtFile
    import ExtImage 

    try: 
        """Try to register the product."""
        
        context.registerClass(
            ExtFile.ExtFile,                        # Which is the addable bit? 
            constructors = (                        # The first of these is called 
                ExtFile.manage_addExtFileForm,      # when someone adds the product; 
                ExtFile.manage_addExtFile),         # the second is named here so we 
                                                    # can give people permission to call it. 
            icon = 'www/extFile.gif'                # This icon was provided by the 
            )                                       # Zope 1 product-in-Python demo. 
            
        context.registerClass(
            ExtImage.ExtImage,                      # Which is the addable bit? 
            constructors = (                        # The first of these is called 
                ExtImage.manage_addExtImageForm,    # when someone adds the product; 
                ExtImage.manage_addExtImage),       # the second is named here so we 
                                                    # can give people permission to call it. 
            icon = 'www/extImage.gif'               # This icon was provided by the 
            )                                       # Zope 1 product-in-Python demo. 
            
        # Mark as five:deprecatedManageAddDelete for Zope >= 2.9
        try:
            from Products.Five.eventconfigure import setDeprecatedManageAddDelete
        except ImportError:
            pass
        else:
            setDeprecatedManageAddDelete(ExtFile.ExtFile)
            setDeprecatedManageAddDelete(ExtImage.ExtImage)
    
    except:
        """If you can't register the product, tell someone."""
        
        import sys, traceback, string
        type, val, tb = sys.exc_info()
        sys.stderr.write(string.join(traceback.format_exception(type, val, tb), ''))
        del type, val, tb

# Import transaction module
try:
    import Zope2
except ImportError:
    # Zope <= 2.7
    import transaction_ as transaction
else:
    import transaction


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>