src/pyams_notify/resources.py
changeset 49 e6d3e3443b84
parent 0 f53281280c23
equal deleted inserted replaced
48:acf504fb9590 49:e6d3e3443b84
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 
    12 
    13 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    14 
    14 
       
    15 from pyramid.interfaces import IRequest
       
    16 from zope.interface import Interface
    15 
    17 
    16 # import standard library
    18 from pyams_notify.skin import pyams_notify
    17 
       
    18 # import interfaces
       
    19 from pyams_skin.interfaces.resources import IResources
    19 from pyams_skin.interfaces.resources import IResources
    20 from pyramid.interfaces import IRequest
    20 from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config
    21 
       
    22 # import packages
       
    23 from pyams_notify.skin import pyams_notify
       
    24 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
       
    25 from zope.interface import Interface
       
    26 
    21 
    27 
    22 
    28 @adapter_config(context=(Interface, IRequest, Interface), provides=IResources)
    23 @adapter_config(context=(Interface, IRequest, Interface), provides=IResources)
    29 class ResourcesAdapter(ContextRequestViewAdapter):
    24 class ResourcesAdapter(ContextRequestViewAdapter):
    30     """Get context resources"""
    25     """Get context resources"""
    31 
    26 
    32     def get_resources(self):
    27     resources = (pyams_notify,)
    33         pyams_notify.need()