|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from pyams_default_theme.layer import IPyAMSDefaultLayer |
|
20 from pyams_skin.interfaces import ISkin |
|
21 from pyams_skin.interfaces.resources import IResources |
|
22 |
|
23 # import packages |
|
24 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter |
|
25 from pyams_utils.registry import utility_config |
|
26 from zope.interface import Interface |
|
27 |
|
28 from pyams_default_theme import _, pyams_default_theme |
|
29 |
|
30 |
|
31 @utility_config(name='PyAMS default skin', provides=ISkin) |
|
32 class PyAMSDefaultSkin(object): |
|
33 """PyAMS default skin""" |
|
34 |
|
35 label = _("PyAMS default skin") |
|
36 layer = IPyAMSDefaultLayer |
|
37 |
|
38 |
|
39 @adapter_config(context=(Interface, IPyAMSDefaultLayer, Interface), provides=IResources) |
|
40 class ResourcesAdapter(ContextRequestViewAdapter): |
|
41 """PyAMS default skin resources""" |
|
42 |
|
43 def get_resources(self): |
|
44 pyams_default_theme.need() |