SLA and Service Directory code added
[unfold.git] / sla / slaclient / templates / templates.py
1 """This module and submodules offers a generic way to create ws-agreement\r
2 representations from structured data, by using templates.\r
3 \r
4 Each submodule (corresponding to a project) is responsible to declare\r
5 the structured data to be used as input, and handle the specific template\r
6 library.\r
7 \r
8 This module only defines a sample interface to be used for each Template object\r
9 used by each project.\r
10 \r
11 Sample usage (read specific submodules' docs):\r
12 data = slaclient.<project>.Input(...)\r
13 tpl = slaclient.<project>.Template(...)\r
14 tpl.render(data)\r
15 \r
16 """\r
17 \r
18 \r
19 class Template(object):\r
20 \r
21     def __init__(self, file_):\r
22         """This is the interface that all project templates should "implement".\r
23 \r
24         It mimics the behavior of django templates.\r
25         """\r
26         pass\r
27 \r
28     def render(self, data):\r
29         """Renders this template using 'data' as input.\r
30         """\r
31         pass\r