GTG

Merge lp:~moogman/gtg/fix_get_tasks_list into lp:~gtg/gtg/old-trunk

Proposed by Kris Marsh
Status: Rejected
Rejected by: Luca Invernizzi
Proposed branch: lp:~moogman/gtg/fix_get_tasks_list
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 71 lines (+13/-8)
4 files modified
GTG/plugins/evolution_sync/gtgProxy.py (+1/-1)
GTG/plugins/notification_area/notification_area.py (+7/-3)
GTG/plugins/rtm_sync/gtgProxy.py (+1/-2)
GTG/plugins/task_reaper/reaper.py (+4/-2)
To merge this branch: bzr merge lp:~moogman/gtg/fix_get_tasks_list
Reviewer Review Type Date Requested Status
Luca Invernizzi (community) Disapprove
Review via email: mp+32682@code.launchpad.net

Description of the change

Remove dependency to removed function get_tasks_list. rtm_sync, evolution_sync, task_reaper plugins should work as intended again.

The fix pretty much does as suggested on bug 529256. I've been able to test the RTM and evolution plugin but not the task_reaper plugin (so let me know if you'd like me to remove the fix for that plugin).

There's only one remaining call to get_tasks_list() - in api.py. It looks like it should possibly be just removed completely, but I wasn't entirely sure.

$ grep get_tasks_list * -nR
Binary file GTG/core/plugins/api.pyc matches
GTG/core/plugins/api.py:385: return self.__requester.get_tasks_list()
Binary file GTG/plugins/rtm_sync/syncEngine.pyc matches
Binary file GTG/plugins/rtm_sync/genericProxy.pyc matches
GTG/plugins/rtm_sync/rtmProxy.py:136: def get_tasks_list(self):
GTG/plugins/rtm_sync/syncEngine.py:88: remote_tasks = self.remote_proxy.get_tasks_list()
GTG/plugins/rtm_sync/syncEngine.py:89: local_tasks = self.local_proxy.get_tasks_list()
GTG/plugins/rtm_sync/genericProxy.py:23: def get_tasks_list(self):
Binary file GTG/plugins/rtm_sync/rtmProxy.pyc matches
Binary file GTG/plugins/evolution_sync/syncEngine.pyc matches
Binary file GTG/plugins/evolution_sync/genericProxy.pyc matches
GTG/plugins/evolution_sync/syncEngine.py:65: remote_tasks = self.remote_proxy.get_tasks_list()
GTG/plugins/evolution_sync/syncEngine.py:66: local_tasks = self.local_proxy.get_tasks_list()
GTG/plugins/evolution_sync/genericProxy.py:23: def get_tasks_list(self):

To post a comment you must log in.
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Hi there. This patch is very nice, but we're rewriting the plugin engine as a result of a major rewrite of GTG internals, so I'll wait for that to land before committing your patch.

You seem to have grasped perfectly how the code works :)
Thanks for this!

review: Approve
Revision history for this message
Kris Marsh (moogman) wrote :

Do you have a timeline on when that'll be merged? Looks like the RTM plugin has fallen buggy, probably because of the mass rewrites you guys are in the process of doing :-) I'd like to chip off some of the bugs, but I'd keep it in a separate branch so will hold off until this is merged. Thanks!

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

No, I don't have a timeline as there is just a few people working on this.
The RTM plugin is being superseded by a RTM "backend" (see http://live.gnome.org/SummerOfCode2010/gtg-backends for an explanation).
The backend is already 99% ready, it just need some polishing. You can have a try using this branch (https://code.edge.launchpad.net/~gtg-user/gtg/multi-backends__invernizzi_gsoc/), but it's still under development, so take care and backup everything before trying.
If you're willing to test it, go to Edit/backends to start (also, you're free to fix bugs :D).

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

I've finished fixing the plugin engine and the plugins, but since we've changed the way tasks are stored internally in GTG, this branch cannot be merged anymore. Well, at least we have plugins working again (and I hope we will release in a short time).
Anyway, thanks a lot for your work, you're very welcome to fix stuff in the future :D

review: Disapprove

Unmerged revisions

869. By Kris Marsh

Rewrite get_tasks_list where it's still needed. Also includes fix for bug 529256

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/plugins/evolution_sync/gtgProxy.py'
2--- GTG/plugins/evolution_sync/gtgProxy.py 2010-03-16 02:16:14 +0000
3+++ GTG/plugins/evolution_sync/gtgProxy.py 2010-08-14 21:24:45 +0000
4@@ -31,7 +31,7 @@
5 requester = self.plugin_api.get_requester()
6 statuses = [Task.STA_ACTIVE, Task.STA_DISMISSED, Task.STA_DONE]
7 tasks = map(self.plugin_api.get_task, \
8- requester.get_tasks_list(status = statuses))
9+ requester.get_custom_tasks_tree().displayed_nodes)
10 map(lambda task: self._tasks_list.append(GtgTask(task, \
11 self.plugin_api, self)), tasks)
12
13
14=== modified file 'GTG/plugins/notification_area/notification_area.py'
15--- GTG/plugins/notification_area/notification_area.py 2010-03-22 05:07:37 +0000
16+++ GTG/plugins/notification_area/notification_area.py 2010-08-14 21:24:45 +0000
17@@ -108,7 +108,10 @@
18 self.requester.connect("task-modified", self.on_task_modified)
19 #initial menu populate, just in case the plugin is not activated at GTG
20 # startup time
21- task_list = self.requester.get_active_tasks_list(workable = True)
22+ customtree = self.requester.get_custom_tasks_tree()
23+ customtree.apply_filter("workview")
24+ customtree.apply_filter("no_disabled_tag")
25+ task_list = customtree.displayed_nodes
26 map(lambda tid: self.on_task_added(self.requester, tid), task_list)
27 #realizing the menu
28 self.menu.show_all()
29@@ -118,8 +121,9 @@
30 in the notification menu - currently only if it's in the
31 workview"""
32 task = self.plugin_api.get_requester().get_task(tid)
33- return task.is_workable() and task.is_started()\
34- and task.get_status() == "Active"
35+ return self.requester.filters.workview(task) and \
36+ self.requester.filters.no_disabled_tag(task)
37+
38
39
40
41
42=== modified file 'GTG/plugins/rtm_sync/gtgProxy.py'
43--- GTG/plugins/rtm_sync/gtgProxy.py 2010-03-21 18:06:10 +0000
44+++ GTG/plugins/rtm_sync/gtgProxy.py 2010-08-14 21:24:45 +0000
45@@ -33,8 +33,7 @@
46 requester = self.plugin_api.get_requester()
47 statuses = [Task.STA_ACTIVE, Task.STA_DISMISSED, Task.STA_DONE]
48 tasks = map(self.plugin_api.get_task, \
49- requester.get_tasks_list(status = statuses, \
50- started_only = False))
51+ requester.get_custom_tasks_tree().displayed_nodes)
52 map(lambda task: self._tasks_list.append(GtgTask(task, \
53 self.plugin_api, self)), tasks)
54
55
56=== modified file 'GTG/plugins/task_reaper/reaper.py'
57--- GTG/plugins/task_reaper/reaper.py 2010-05-12 00:52:05 +0000
58+++ GTG/plugins/task_reaper/reaper.py 2010-08-14 21:24:45 +0000
59@@ -116,8 +116,10 @@
60 self.__log("Starting deletion of old tasks")
61 today = datetime.datetime.now().date()
62 requester = self.plugin_api.get_requester()
63- closed_tids = requester.get_tasks_list(status = [Task.STA_DISMISSED,
64- Task.STA_DONE])
65+ customtree = self.requester.get_custom_tasks_tree()
66+ customtree.apply_filter(Task.STA_DISMISSED)
67+ customtree.apply_filter(Task.STA_DONE)
68+ closed_tids = customtree.displayed_nodes
69 closed_tasks = [requester.get_task(tid) for tid in closed_tids]
70 #print [t.get_title() for t in closed_tasks]
71 delta = datetime.timedelta(days = self.preferences["max_days"])

Subscribers

People subscribed via source and target branches

to status/vote changes: