def _extract_all_actions():
path = os.path.dirname(mistral_actions.__file__)
base_len = len(path[:-len(mistral_actions.__name__)])
action_list = []
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith('.py') and not f.startswith('_'):
module_name = (root + '/' + f)[base_len:-len('.py')].replace(
'/', '.')
module = importutils.import_module(module_name)
action_list.extend(_extract_actions_from_module(module))
return action_list
评论列表
文章目录