1 | Export adapters section |
---|
2 | ======================= |
---|
3 | |
---|
4 | The export adapters section blueprint name is |
---|
5 | ``quintagroup.transmogrifier.exportadapters``. |
---|
6 | |
---|
7 | Export adapters needs at least 2 piece of information: the path to the object |
---|
8 | to update and data dictionary which determine, what adapters will be queried and |
---|
9 | what data they will consume. To determine the path, the marshall section inspects |
---|
10 | each item and looks for one key, as described below. Any item missing this piece of |
---|
11 | information will be skipped. Similarly, items with a path that doesn't exist |
---|
12 | or without data dictionary will be skipped too. |
---|
13 | |
---|
14 | Paths to objects are always interpreted as relative to the context. |
---|
15 | |
---|
16 | >>> exportadapters = """ |
---|
17 | ... [transmogrifier] |
---|
18 | ... pipeline = |
---|
19 | ... exportadapterssource |
---|
20 | ... exportadapters |
---|
21 | ... printer |
---|
22 | ... |
---|
23 | ... [exportadapterssource] |
---|
24 | ... blueprint = quintagroup.transmogrifier.tests.exportadapterssource |
---|
25 | ... |
---|
26 | ... [exportadapters] |
---|
27 | ... blueprint = quintagroup.transmogrifier.exportadapters |
---|
28 | ... data-key = _files |
---|
29 | ... |
---|
30 | ... [printer] |
---|
31 | ... blueprint = collective.transmogrifier.sections.tests.pprinter |
---|
32 | ... |
---|
33 | ... """ |
---|
34 | >>> registerConfig(u'quintagroup.transmogrifier.tests.exportadapters', exportadapters) |
---|
35 | >>> transmogrifier(u'quintagroup.transmogrifier.tests.exportadapters') # doctest: +ELLIPSIS, +REPORT_NDIFF |
---|
36 | {'_files': {'unchanged': 'this must be unchanged', 'mock': 'modified data'}, |
---|
37 | '_path': 'spam/eggs/foo'} |
---|
38 | {'_path': 'not/existing/bar'} |
---|
39 | {} |
---|
40 | {'_files': {'mock': "item hasn't path"}} |
---|
41 | {'_files': {'mock': "object isn't adaptable"}, |
---|
42 | '_path': 'spam/eggs/notadaptable'} |
---|