--- a/eric6/Tasks/TaskViewer.py Sat May 01 18:48:35 2021 +0200 +++ b/eric6/Tasks/TaskViewer.py Sat May 01 20:28:00 2021 +0200 @@ -25,7 +25,7 @@ from E5Gui import E5MessageBox from E5Gui.E5ProgressDialog import E5ProgressDialog -from .Task import Task +from .Task import Task, TaskType import UI.PixmapCache @@ -320,26 +320,37 @@ def addTask(self, summary, priority=1, filename="", lineno=0, completed=False, _time=0, isProjectTask=False, - taskType=Task.TypeTodo, description="", uid="", + taskType=TaskType.TODO, description="", uid="", parentTask=None): """ Public slot to add a task. - @param summary summary text of the task (string) + @param summary summary text of the task + @type str @param priority priority of the task (0=high, 1=normal, 2=low) - @param filename filename containing the task (string) - @param lineno line number containing the task (integer) - @param completed flag indicating completion status (boolean) - @param _time creation time of the task (float, if 0 use current time) + @type int + @param filename filename containing the task + @type str + @param lineno line number containing the task + @type int + @param completed flag indicating completion status + @type bool + @param _time creation time of the task (if 0 use current time) + @type float @param isProjectTask flag indicating a task related to the current - project (boolean) - @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, - Task.TypeWarning, Task.TypeNote) - @param description explanatory text of the task (string) - @param uid unique id of the task (string) - @param parentTask reference to the parent task item (Task) or the - UID of the parent task - @return reference to the task item (Task) + project + @type bool + @param taskType type of the task + @type TaskType + @param description explanatory text of the task + @type str + @param uid unique id of the task + @type str + @param parentTask reference to the parent task item or the UID of the + parent task + @type Task or str + @return reference to the task item + @rtype Task """ if isinstance(parentTask, str): # UID of parent task @@ -377,23 +388,27 @@ return task - def addFileTask(self, summary, filename, lineno, taskType=Task.TypeTodo, + def addFileTask(self, summary, filename, lineno, taskType=TaskType.TODO, description=""): """ Public slot to add a file related task. - @param summary summary text of the task (string) - @param filename filename containing the task (string) - @param lineno line number containing the task (integer) - @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, - Task.TypeWarning, Task.TypeNote) - @param description explanatory text of the task (string) + @param summary summary text of the task + @type str + @param filename filename containing the task + @type str + @param lineno line number containing the task + @type int + @param taskType type of the task + @type TaskType + @param description explanatory text of the task + @type str """ self.addTask(summary, filename=filename, lineno=lineno, isProjectTask=( self.project and self.project.isProjectSource(filename)), - taskType=taskType, description=description) + taskType=TaskType(taskType), description=description) def getProjectTasks(self): """ @@ -816,11 +831,11 @@ """ Class implementing a thread to extract tasks related to a project. - @signal taskFound(str, str, int, int) emitted with the task description, - the file name, the line number and task type to signal the presence of - a task + @signal taskFound(str, str, int, TaskType) emitted with the task + description, the file name, the line number and task type to signal + the presence of a task """ - taskFound = pyqtSignal(str, str, int, int) + taskFound = pyqtSignal(str, str, int, TaskType) def __init__(self, parent=None): """