318 """ |
318 """ |
319 self.projectOpen = o |
319 self.projectOpen = o |
320 |
320 |
321 def addTask(self, summary, priority=1, filename="", lineno=0, |
321 def addTask(self, summary, priority=1, filename="", lineno=0, |
322 completed=False, _time=0, isProjectTask=False, |
322 completed=False, _time=0, isProjectTask=False, |
323 taskType=Task.TypeTodo, description="", uid="", |
323 taskType=TaskType.TODO, description="", uid="", |
324 parentTask=None): |
324 parentTask=None): |
325 """ |
325 """ |
326 Public slot to add a task. |
326 Public slot to add a task. |
327 |
327 |
328 @param summary summary text of the task (string) |
328 @param summary summary text of the task |
|
329 @type str |
329 @param priority priority of the task (0=high, 1=normal, 2=low) |
330 @param priority priority of the task (0=high, 1=normal, 2=low) |
330 @param filename filename containing the task (string) |
331 @type int |
331 @param lineno line number containing the task (integer) |
332 @param filename filename containing the task |
332 @param completed flag indicating completion status (boolean) |
333 @type str |
333 @param _time creation time of the task (float, if 0 use current time) |
334 @param lineno line number containing the task |
|
335 @type int |
|
336 @param completed flag indicating completion status |
|
337 @type bool |
|
338 @param _time creation time of the task (if 0 use current time) |
|
339 @type float |
334 @param isProjectTask flag indicating a task related to the current |
340 @param isProjectTask flag indicating a task related to the current |
335 project (boolean) |
341 project |
336 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, |
342 @type bool |
337 Task.TypeWarning, Task.TypeNote) |
343 @param taskType type of the task |
338 @param description explanatory text of the task (string) |
344 @type TaskType |
339 @param uid unique id of the task (string) |
345 @param description explanatory text of the task |
340 @param parentTask reference to the parent task item (Task) or the |
346 @type str |
341 UID of the parent task |
347 @param uid unique id of the task |
342 @return reference to the task item (Task) |
348 @type str |
|
349 @param parentTask reference to the parent task item or the UID of the |
|
350 parent task |
|
351 @type Task or str |
|
352 @return reference to the task item |
|
353 @rtype Task |
343 """ |
354 """ |
344 if isinstance(parentTask, str): |
355 if isinstance(parentTask, str): |
345 # UID of parent task |
356 # UID of parent task |
346 if parentTask == "": |
357 if parentTask == "": |
347 parentUid = "" |
358 parentUid = "" |
375 if isProjectTask: |
386 if isProjectTask: |
376 self.__projectTasksSaveTimer.changeOccurred() |
387 self.__projectTasksSaveTimer.changeOccurred() |
377 |
388 |
378 return task |
389 return task |
379 |
390 |
380 def addFileTask(self, summary, filename, lineno, taskType=Task.TypeTodo, |
391 def addFileTask(self, summary, filename, lineno, taskType=TaskType.TODO, |
381 description=""): |
392 description=""): |
382 """ |
393 """ |
383 Public slot to add a file related task. |
394 Public slot to add a file related task. |
384 |
395 |
385 @param summary summary text of the task (string) |
396 @param summary summary text of the task |
386 @param filename filename containing the task (string) |
397 @type str |
387 @param lineno line number containing the task (integer) |
398 @param filename filename containing the task |
388 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, |
399 @type str |
389 Task.TypeWarning, Task.TypeNote) |
400 @param lineno line number containing the task |
390 @param description explanatory text of the task (string) |
401 @type int |
|
402 @param taskType type of the task |
|
403 @type TaskType |
|
404 @param description explanatory text of the task |
|
405 @type str |
391 """ |
406 """ |
392 self.addTask(summary, filename=filename, lineno=lineno, |
407 self.addTask(summary, filename=filename, lineno=lineno, |
393 isProjectTask=( |
408 isProjectTask=( |
394 self.project and |
409 self.project and |
395 self.project.isProjectSource(filename)), |
410 self.project.isProjectSource(filename)), |
396 taskType=taskType, description=description) |
411 taskType=TaskType(taskType), description=description) |
397 |
412 |
398 def getProjectTasks(self): |
413 def getProjectTasks(self): |
399 """ |
414 """ |
400 Public method to retrieve all project related tasks. |
415 Public method to retrieve all project related tasks. |
401 |
416 |
814 |
829 |
815 class ProjectTaskExtractionThread(QThread): |
830 class ProjectTaskExtractionThread(QThread): |
816 """ |
831 """ |
817 Class implementing a thread to extract tasks related to a project. |
832 Class implementing a thread to extract tasks related to a project. |
818 |
833 |
819 @signal taskFound(str, str, int, int) emitted with the task description, |
834 @signal taskFound(str, str, int, TaskType) emitted with the task |
820 the file name, the line number and task type to signal the presence of |
835 description, the file name, the line number and task type to signal |
821 a task |
836 the presence of a task |
822 """ |
837 """ |
823 taskFound = pyqtSignal(str, str, int, int) |
838 taskFound = pyqtSignal(str, str, int, TaskType) |
824 |
839 |
825 def __init__(self, parent=None): |
840 def __init__(self, parent=None): |
826 """ |
841 """ |
827 Constructor |
842 Constructor |
828 |
843 |