Correct individual id to pass to command line option ?



Hi,

I was trying to take advantage of shell search provider dbus interface for gnome-contacts to search and open contacts for app-launchers like kupfer or synapse. (Ideally I should probably access eds backend through python gobject, but that's not reason why it shouldn't work for dbus in the first place)

For Gnome calendar,

bus = dbus.SessionBus()
proxy = bus.get_object("org.gnome.Calendar", 
                       "/org/gnome/Calendar/SearchProvider")
iface = dbus.Interface(proxy, "org.gnome.Shell.SearchProvider2")
event_uids = iface.GetInitialResultSet([""])

...directly returns uids of events which then, I can pass to "gnome-calendar --uuid $uuid" to open that particular event in calendar.

However it doesn't work for contacts. 

bus = dbus.SessionBus()
proxy = bus.get_object("org.gnome.Contacts.SearchProvider", 
                       "/org/gnome/Contacts/SearchProvider")
iface = dbus.Interface(proxy, "org.gnome.Shell.SearchProvider2")

contact_ids = iface.GetInitialResultSet([""])
for contact_id in contacts_ids:
    print (contact_id)


It gave me search ids (1, 77, 134) instead of uids. I also tried using folks-inspect. For example,

$folks-inspect personas 'eds:1428657577.4552.2@saturnica:pas-id-552925C400000080'

Persona 'eds:1428657577.4552.2@saturnica:pas-id-552925C400000080':
  iid 1428657577.4552.2@saturnica:pas-id-552925C400000080
  uid eds:1428657577.4552.2@saturnica:pas-id-552925C400000080
  display-id 1428657577.4552.2@saturnica:pas-id-552925C400000080
  is-user FALSE
  store 0x9c0b5b0: eds, 1428657577.4552.2@saturnica (Android)
  individual 0x9ec9d58
  contact 0xb4f766a8

I tried iid, uid, display-id to command line like "gnome-contacts --individual $iid "......but nothing worked. I am always getting "individual id not found"

So what should be correct "individual ID" in above case? 

Thanks.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]