1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-20 23:31:30 +03:00
leon/bridges/python/main.py

21 lines
489 B
Python

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from sys import argv, path
from json import dumps, loads
from importlib import import_module
def main():
"""Dynamically import modules related to the args and print the ouput"""
path.append('.')
queryobj = utils.getqueryobj()
m = import_module('packages.' + queryobj['package'] + '.' + queryobj['module'])
return getattr(m, queryobj['module'])(queryobj['query'], queryobj['entities'])
if __name__ == '__main__':
main()