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
=== modified file 'GTG/plugins/evolution_sync/gtgProxy.py'
--- GTG/plugins/evolution_sync/gtgProxy.py 2010-03-16 02:16:14 +0000
+++ GTG/plugins/evolution_sync/gtgProxy.py 2010-08-14 21:24:45 +0000
@@ -31,7 +31,7 @@
31 requester = self.plugin_api.get_requester()31 requester = self.plugin_api.get_requester()
32 statuses = [Task.STA_ACTIVE, Task.STA_DISMISSED, Task.STA_DONE]32 statuses = [Task.STA_ACTIVE, Task.STA_DISMISSED, Task.STA_DONE]
33 tasks = map(self.plugin_api.get_task, \33 tasks = map(self.plugin_api.get_task, \
34 requester.get_tasks_list(status = statuses))34 requester.get_custom_tasks_tree().displayed_nodes)
35 map(lambda task: self._tasks_list.append(GtgTask(task, \35 map(lambda task: self._tasks_list.append(GtgTask(task, \
36 self.plugin_api, self)), tasks)36 self.plugin_api, self)), tasks)
3737
3838
=== modified file 'GTG/plugins/notification_area/notification_area.py'
--- GTG/plugins/notification_area/notification_area.py 2010-03-22 05:07:37 +0000
+++ GTG/plugins/notification_area/notification_area.py 2010-08-14 21:24:45 +0000
@@ -108,7 +108,10 @@
108 self.requester.connect("task-modified", self.on_task_modified)108 self.requester.connect("task-modified", self.on_task_modified)
109 #initial menu populate, just in case the plugin is not activated at GTG109 #initial menu populate, just in case the plugin is not activated at GTG
110 # startup time110 # startup time
111 task_list = self.requester.get_active_tasks_list(workable = True)111 customtree = self.requester.get_custom_tasks_tree()
112 customtree.apply_filter("workview")
113 customtree.apply_filter("no_disabled_tag")
114 task_list = customtree.displayed_nodes
112 map(lambda tid: self.on_task_added(self.requester, tid), task_list)115 map(lambda tid: self.on_task_added(self.requester, tid), task_list)
113 #realizing the menu116 #realizing the menu
114 self.menu.show_all()117 self.menu.show_all()
@@ -118,8 +121,9 @@
118 in the notification menu - currently only if it's in the121 in the notification menu - currently only if it's in the
119 workview"""122 workview"""
120 task = self.plugin_api.get_requester().get_task(tid)123 task = self.plugin_api.get_requester().get_task(tid)
121 return task.is_workable() and task.is_started()\124 return self.requester.filters.workview(task) and \
122 and task.get_status() == "Active"125 self.requester.filters.no_disabled_tag(task)
126
123 127
124128
125129
126130
=== modified file 'GTG/plugins/rtm_sync/gtgProxy.py'
--- GTG/plugins/rtm_sync/gtgProxy.py 2010-03-21 18:06:10 +0000
+++ GTG/plugins/rtm_sync/gtgProxy.py 2010-08-14 21:24:45 +0000
@@ -33,8 +33,7 @@
33 requester = self.plugin_api.get_requester()33 requester = self.plugin_api.get_requester()
34 statuses = [Task.STA_ACTIVE, Task.STA_DISMISSED, Task.STA_DONE]34 statuses = [Task.STA_ACTIVE, Task.STA_DISMISSED, Task.STA_DONE]
35 tasks = map(self.plugin_api.get_task, \35 tasks = map(self.plugin_api.get_task, \
36 requester.get_tasks_list(status = statuses, \36 requester.get_custom_tasks_tree().displayed_nodes)
37 started_only = False))
38 map(lambda task: self._tasks_list.append(GtgTask(task, \37 map(lambda task: self._tasks_list.append(GtgTask(task, \
39 self.plugin_api, self)), tasks)38 self.plugin_api, self)), tasks)
4039
4140
=== modified file 'GTG/plugins/task_reaper/reaper.py'
--- GTG/plugins/task_reaper/reaper.py 2010-05-12 00:52:05 +0000
+++ GTG/plugins/task_reaper/reaper.py 2010-08-14 21:24:45 +0000
@@ -116,8 +116,10 @@
116 self.__log("Starting deletion of old tasks")116 self.__log("Starting deletion of old tasks")
117 today = datetime.datetime.now().date()117 today = datetime.datetime.now().date()
118 requester = self.plugin_api.get_requester()118 requester = self.plugin_api.get_requester()
119 closed_tids = requester.get_tasks_list(status = [Task.STA_DISMISSED,119 customtree = self.requester.get_custom_tasks_tree()
120 Task.STA_DONE])120 customtree.apply_filter(Task.STA_DISMISSED)
121 customtree.apply_filter(Task.STA_DONE)
122 closed_tids = customtree.displayed_nodes
121 closed_tasks = [requester.get_task(tid) for tid in closed_tids]123 closed_tasks = [requester.get_task(tid) for tid in closed_tids]
122 #print [t.get_title() for t in closed_tasks]124 #print [t.get_title() for t in closed_tasks]
123 delta = datetime.timedelta(days = self.preferences["max_days"])125 delta = datetime.timedelta(days = self.preferences["max_days"])

Subscribers

People subscribed via source and target branches

to status/vote changes: