MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / _taskproducer

Method _taskproducer

client/task/taskmgr.py:80–94  ·  view source on GitHub ↗

task对象生成 :param task_type: 任务类型 :return: 返回一个task任务的对象

(self, task_type)

Source from the content-addressed store, hash-verified

78 return self.params
79
80 def _taskproducer(self, task_type):
81 '''
82 task对象生成
83 :param task_type: 任务类型
84 :return: 返回一个task任务的对象
85 '''
86 try:
87 if not task_type == 'datahandle':
88 getattr(self.tool, task_type)
89 except AttributeError: # 表示tool的对应app中未实现task相应函数
90 return None
91 task_file = __import__('task.model.' + task_type)
92 model = getattr(task_file, 'model')
93 task = getattr(model, task_type).task
94 return task(self.tool)
95
96 @staticmethod
97 def check_tool_usable(tool_name, task_params):

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected