forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.py
More file actions
30 lines (24 loc) · 1.23 KB
/
plugin.py
File metadata and controls
30 lines (24 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Plugins are sub-sets of templates, it encapsulate common behavior of different templates and plugged to each of them
"""
from typing import NamedTuple
from samcli.lib.cookiecutter.interactive_flow import InteractiveFlow
from samcli.lib.cookiecutter.processor import Processor
class Plugin(NamedTuple):
"""
A plugin is a sub cookiecutter template. it has its own interactive_flow to prompt the user for answers to
its own context and it also has its preprocessor and postprocessor. plugin's components are appended to the
templates corresponding component; interactive_flows, preprocessors and postprocessors.
plugins encapsulate common logic of different templates in one place to be passed(plugged) to each template.
Attributes
----------
interactive_flow: InteractiveFlow
a flow of questions to be appended to the series of interactive_flows of the parent template.
preprocessor: Processor
a processor to be appended to the series of processors of the parent template.
postprocessor: Processor
a processor to be appended to the series of postprocessors of the parent template.
"""
interactive_flow: InteractiveFlow
preprocessor: Processor
postprocessor: Processor