Annotation of ExtFile/__init__.py, revision 1.1
1.1 ! dwinter 1: __doc__ = """ExtFile initialization module. """
! 2: __version__ = '1.5.4'
! 3:
! 4: def initialize(context):
! 5: """Initialize the ExtFile product."""
! 6:
! 7: import ExtFile
! 8: import ExtImage
! 9:
! 10: try:
! 11: """Try to register the product."""
! 12:
! 13: context.registerClass(
! 14: ExtFile.ExtFile, # Which is the addable bit?
! 15: constructors = ( # The first of these is called
! 16: ExtFile.manage_addExtFileForm, # when someone adds the product;
! 17: ExtFile.manage_addExtFile), # the second is named here so we
! 18: # can give people permission to call it.
! 19: icon = 'www/extFile.gif' # This icon was provided by the
! 20: ) # Zope 1 product-in-Python demo.
! 21:
! 22: context.registerClass(
! 23: ExtImage.ExtImage, # Which is the addable bit?
! 24: constructors = ( # The first of these is called
! 25: ExtImage.manage_addExtImageForm, # when someone adds the product;
! 26: ExtImage.manage_addExtImage), # the second is named here so we
! 27: # can give people permission to call it.
! 28: icon = 'www/extImage.gif' # This icon was provided by the
! 29: ) # Zope 1 product-in-Python demo.
! 30:
! 31: # Mark as five:deprecatedManageAddDelete for Zope >= 2.9
! 32: try:
! 33: from Products.Five.eventconfigure import setDeprecatedManageAddDelete
! 34: except ImportError:
! 35: pass
! 36: else:
! 37: setDeprecatedManageAddDelete(ExtFile.ExtFile)
! 38: setDeprecatedManageAddDelete(ExtImage.ExtImage)
! 39:
! 40: except:
! 41: """If you can't register the product, tell someone."""
! 42:
! 43: import sys, traceback, string
! 44: type, val, tb = sys.exc_info()
! 45: sys.stderr.write(string.join(traceback.format_exception(type, val, tb), ''))
! 46: del type, val, tb
! 47:
! 48: # Import transaction module
! 49: try:
! 50: import Zope2
! 51: except ImportError:
! 52: # Zope <= 2.7
! 53: import transaction_ as transaction
! 54: else:
! 55: import transaction
! 56:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>