40 |
40 |
41 def setActive(self, enabled): |
41 def setActive(self, enabled): |
42 """ |
42 """ |
43 Public method to activate the filter. |
43 Public method to activate the filter. |
44 |
44 |
45 @param enabled flag indicating the activation state (boolean) |
45 @param enabled flag indicating the activation state |
|
46 @type bool |
46 """ |
47 """ |
47 self.active = enabled |
48 self.active = enabled |
48 |
49 |
49 def setSummaryFilter(self, filterStr): |
50 def setSummaryFilter(self, filterStr): |
50 """ |
51 """ |
51 Public method to set the description filter. |
52 Public method to set the description filter. |
52 |
53 |
53 @param filterStr a regular expression for the description filter |
54 @param filterStr a regular expression for the description filter to set |
54 to set (string) or None |
55 @type str |
55 """ |
56 """ |
56 if not filterStr: |
57 if not filterStr: |
57 self.summaryFilter = None |
58 self.summaryFilter = None |
58 else: |
59 else: |
59 self.summaryFilter = re.compile(filterStr) |
60 self.summaryFilter = re.compile(filterStr) |
60 |
61 |
61 def setFileNameFilter(self, filterStr): |
62 def setFileNameFilter(self, filterStr): |
62 """ |
63 """ |
63 Public method to set the filename filter. |
64 Public method to set the filename filter. |
64 |
65 |
65 @param filterStr a wildcard expression for the filename filter |
66 @param filterStr a wildcard expression for the filename filter to set |
66 to set (string) or None |
67 @type str |
67 """ |
68 """ |
68 self.filenameFilter = filterStr |
69 self.filenameFilter = filterStr |
69 |
70 |
70 def setTypeFilter(self, taskType): |
71 def setTypeFilter(self, taskType): |
71 """ |
72 """ |
78 |
79 |
79 def setScopeFilter(self, scope): |
80 def setScopeFilter(self, scope): |
80 """ |
81 """ |
81 Public method to set the scope filter. |
82 Public method to set the scope filter. |
82 |
83 |
83 @param scope flag indicating a project task (boolean) or None |
84 @param scope flag indicating a project task |
|
85 @type bool |
84 """ |
86 """ |
85 self.scopeFilter = scope |
87 self.scopeFilter = scope |
86 |
88 |
87 def setStatusFilter(self, status): |
89 def setStatusFilter(self, status): |
88 """ |
90 """ |
89 Public method to set the status filter. |
91 Public method to set the status filter. |
90 |
92 |
91 @param status flag indicating a completed task (boolean) or None |
93 @param status flag indicating a completed task |
|
94 @type bool |
92 """ |
95 """ |
93 self.statusFilter = status |
96 self.statusFilter = status |
94 |
97 |
95 def setPrioritiesFilter(self, priorities): |
98 def setPrioritiesFilter(self, priorities): |
96 """ |
99 """ |
103 |
106 |
104 def hasActiveFilter(self): |
107 def hasActiveFilter(self): |
105 """ |
108 """ |
106 Public method to check for active filters. |
109 Public method to check for active filters. |
107 |
110 |
108 @return flag indicating an active filter was found (boolean) |
111 @return flag indicating an active filter was found |
|
112 @rtype bool |
109 """ |
113 """ |
110 return ( |
114 return ( |
111 self.summaryFilter is not None |
115 self.summaryFilter is not None |
112 or bool(self.filenameFilter) |
116 or bool(self.filenameFilter) |
113 or self.typeFilter != TaskType.NONE |
117 or self.typeFilter != TaskType.NONE |
118 |
122 |
119 def showTask(self, task): |
123 def showTask(self, task): |
120 """ |
124 """ |
121 Public method to check, if a task should be shown. |
125 Public method to check, if a task should be shown. |
122 |
126 |
123 @param task reference to the task object to check (Task) |
127 @param task reference to the task object to check |
124 @return flag indicating whether the task should be shown (boolean) |
128 @type Task |
|
129 @return flag indicating whether the task should be shown |
|
130 @rtype bool |
125 """ |
131 """ |
126 if not self.active: |
132 if not self.active: |
127 return True |
133 return True |
128 |
134 |
129 if self.summaryFilter and self.summaryFilter.search(task.summary) is None: |
135 if self.summaryFilter and self.summaryFilter.search(task.summary) is None: |