Back to index

plone3  3.1.7
cssregistry.py
Go to the documentation of this file.
00001 from Products.ResourceRegistries.interfaces import ICSSRegistry
00002 
00003 from resourceregistry import ResourceRegistryNodeAdapter, \
00004      importResRegistry, exportResRegistry
00005 
00006 _FILENAME = 'cssregistry.xml'
00007 _REG_ID = 'portal_css'
00008 _REG_TITLE = 'Stylesheet registry'
00009 
00010 def importCSSRegistry(context):
00011     """
00012     Import CSS registry.
00013     """
00014     return importResRegistry(context, _REG_ID, _REG_TITLE, _FILENAME)
00015 
00016 def exportCSSRegistry(context):
00017     """
00018     Export CSS registry.
00019     """
00020     return exportResRegistry(context, _REG_ID, _REG_TITLE, _FILENAME)
00021 
00022 
00023 class CSSRegistryNodeAdapter(ResourceRegistryNodeAdapter):
00024     """
00025     Node im- and exporter for CSSRegistry.
00026     """
00027 
00028     __used_for__ = ICSSRegistry
00029     registry_id = _REG_ID
00030     resource_type = 'stylesheet'
00031     register_method = 'registerStylesheet'
00032     update_method = 'updateStylesheet'