import os.path
__version__ = open(os.path.join(__path__[0], 'version.txt')).read().strip()

from Products.PortalTransforms.utils import skins_dir
from Products.PortalTransforms.TransformEngine import TransformTool

GLOBALS = globals()
PKG_NAME = 'PortalTransforms'

tools = (
    TransformTool,
    )

# XXX backward compatibility tricks to make old PortalTransform based Mimetypes
# running (required)
import sys
this_module = sys.modules[__name__]

from Products.MimetypesRegistry import mime_types
setattr(this_module, 'mime_types', mime_types)

from Products.MimetypesRegistry import MimeTypeItem
setattr(this_module, 'MimeTypeItem', MimeTypeItem)

from Products.MimetypesRegistry import MimeTypeItem
sys.modules['Products.PortalTransforms.zope.MimeTypeItem'] = MimeTypeItem

def initialize(context):
    from Products.CMFCore.DirectoryView import registerDirectory
    #registerDirectory(skins_dir, GLOBALS)

    from Products.CMFCore import utils
    utils.ToolInit("%s Tool" % PKG_NAME, tools=tools,
                   product_name=PKG_NAME,
                   icon="tool.gif",
                   ).initialize(context)
