← Back to team overview

gtg team mailing list archive

[Bug 534840] Re: dbuswrapper.py in viewmanager generates traceback

 

I've updated the dbus commands on the 0.3 branch to work with the new
filters system.  I did have to change the API a bit since some of the
internal functionality has changed around.

get_tasks_filtered() and get_task_ids_filtered() are the major changes.
Both routines are still present but their parameter signatures are
changed - they now use filters directly.  Unfortunately because of this
they no longer support searching by tags, but on the plus side they now
will work with any filter, so as new filters are added in the future,
this will all "just work".

get_task_ids() is dropped.  I decided if someone needs that, they can
just use get_task_ids_filtered().

I decided to keep get_tasks() as a convenience function.  Basically it
just calls self.get_tasks_filtered(['all'])

Anyway, I've tested that these changes fix the issue in the description
of this bug report, so it should be good to go.

Also, I've implemented a command line tool gtcli in trunk which can be
used as a reference for other dbus clients.  I plan to continue
maintaining this and adding to it, and patches for it are of course
quite welcome!

** Changed in: gtg
       Status: Invalid => Fix Committed

** Changed in: gtg
    Milestone: None => 0.3

** Changed in: gtg
     Assignee: Luca Invernizzi (invernizzi) => Bryce Harrington (bryceharrington)

-- 
dbuswrapper.py in viewmanager generates traceback
https://bugs.launchpad.net/bugs/534840
You received this bug notification because you are a member of Gtg
contributors, which is subscribed to Getting Things GNOME!.

Status in Getting Things GNOME!: Fix Committed

Bug description:
When I execute the following code 

import dbus
bus = dbus.SessionBus()
obj = bus.get_object("org.GTG", "/org/GTG")
gtg = dbus.Interface(obj, "org.GTG")
for t in gtg.get_tasks():
    print t
    print t["title"]


I get the following traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/local/lib/python2.6/dist-packages/GTG/viewmanager/dbuswrapper.py", line 74, in get_tasks
    return [self.get_task(id) for id in self.get_task_ids(u"Active")]
  File "/usr/local/lib/python2.6/dist-packages/GTG/viewmanager/dbuswrapper.py", line 63, in get_task_ids
    return self.req.get_tasks_list(status = status)
AttributeError: 'Requester' object has no attribute 'get_tasks_list'


This same code used to work since version 649 (fixed by Luca).





References