1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-27 02:35:50 +03:00
leon/bridges/python/main.py
2019-05-03 23:31:09 +08:00

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['action'])(queryobj['query'], queryobj['entities'])
if __name__ == '__main__':
main()