-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.py
More file actions
25 lines (19 loc) · 727 Bytes
/
core.py
File metadata and controls
25 lines (19 loc) · 727 Bytes
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
import importlib
class Generator:
def __init__(self, provider: str):
if provider is not None:
plugin = f'bpmn2faas_{provider}_plugin_python'
try:
self._plugin = importlib.import_module('.main', 'plugins.' + plugin).Plugin()
except ModuleNotFoundError:
raise ModuleNotFoundError(f'Plugin {plugin} not found!')
else:
raise ImportError('No plugin provided')
def generate(self, path: str, endpoints: dict) -> str :
print('Starting Plugin')
print('-' * 10)
output = self._plugin.generate(path, endpoints)
print('-' * 10)
print('Ending Plugin')
print()
return output