Back to index

plone3  3.1.7
Functions | Variables
kss.core.pluginregistry._concatresource.meta Namespace Reference

Functions

def concatresource

Variables

 __five__ = False
 _layer = IDefaultBrowserLayer
 __pre_3_2__ = False
 __pre_3_3__ = False
tuple allowed_names
dictionary _factory_map

Function Documentation

def kss.core.pluginregistry._concatresource.meta.concatresource (   _context,
  name,
  files = None,
  compress_level = 'safe',
  caching = 'default',
  lmt_check_period = 60.0,
  layer = _layer,
  permission = 'zope.Public' 
)

Definition at line 50 of file meta.py.

00050 
00051         layer=_layer, permission='zope.Public'):
00052 
00053     if not files:
00054         raise ConfigurationError(
00055             "Must use a files"
00056             " attribute for concatresource directives, with at least"
00057             " one file contained."
00058             )
00059 
00060     res = files
00061     res_type = 'files'
00062     factory_info = _factory_map.get(res_type)
00063     factory_info['count'] += 1
00064     res_factory = factory_info['factory']
00065 
00066     if __five__:
00067         checker = None
00068         _class_name = '%s%s' % (factory_info['prefix'], factory_info['count'])
00069         new_class = makeClass(_class_name, (res_factory.resource,), {})
00070 
00071         _context.action(
00072             discriminator = ('five:protectClass', new_class),
00073             callable = protectClass,
00074             args = (new_class, permission)
00075             )
00076         _context.action(
00077             discriminator = ('five:initialize:class', new_class),
00078             callable = initializeClass,
00079             args = (new_class,)
00080             )
00081 
00082     else:
00083         new_class = res_factory.resource
00084 
00085         if permission == 'zope.Public':
00086             permission = CheckerPublic
00087 
00088         checker = NamesChecker(allowed_names, permission)
00089 
00090     factory = res_factory(res, name, compress_level, caching, lmt_check_period,
00091             resource_factory=new_class, checker=checker)
00092 
00093     if __pre_3_2__:
00094         _context.action(
00095             discriminator = ('resource', name, IBrowserRequest, layer),
00096             callable = handler,
00097             args = (Presentation, 'provideResource',
00098                     name, IBrowserRequest, factory, layer),
00099             )
00100     else:
00101         if __pre_3_3__:
00102             _context.action(
00103                 discriminator = ('resource', name, IBrowserRequest, layer),
00104                 callable = handler,
00105                 args = ('provideAdapter',
00106                     (layer,), Interface, name, factory, _context.info),
00107                 )
00108         else:
00109             _context.action(
00110                 discriminator = ('resource', name, IBrowserRequest, layer),
00111                 callable = handler,
00112                 args = ('registerAdapter',
00113                     factory, (layer,), Interface, name, _context.info),
00114                 )

Variable Documentation

Definition at line 13 of file meta.py.

Definition at line 23 of file meta.py.

Definition at line 31 of file meta.py.

Initial value:
00001 {
00002     'files': {
00003         'prefix': 'ConcatResource',
00004         'count': 0,
00005         'factory': ConcatResourceFactory
00006         },
00007     }

Definition at line 40 of file meta.py.

Definition at line 22 of file meta.py.

Initial value:
00001 ('GET', 'HEAD', 'publishTraverse', 'browserDefault',
00002                  'request', '__call__')

Definition at line 36 of file meta.py.