Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Dbus Help

    Reply
    Page 2 of 2 | Prev |   1   2 |
    xur17 | # 11 | 2010-10-09, 01:56 | Report

    Originally Posted by daperl View Post
    I think all is answered by following nicolai's link and the dbus-python tutorial. According to the Data Types section, dbus.Dictionary is a sub-class of dict.

    Remove the '*' from '*arg' and arg should just be a dbus.Dictionary.
    I still don't understand exactly how to access the dictionary variable. Is a dbus.dictionary variable the same as a regular dictionary variable?

    I have been playing around with my handle_presence function (here's what it looks like). Can you give me a little more help to get this to work?:

    Code:
    def handle_presence(dictionary):
    	print type(dictionary)
    	print dictionary.keys()
    	for x in dictionary.keys():
    		print x
    		print type(dictionary[x])
    		print dictionary[x]
    	print "status changed"
    I really appreciate your help.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    xur17 | # 12 | 2010-10-09, 04:09 | Report

    I ended up getting it to work by using the db2p function at the bottom of this page: http://telepathy.freedesktop.org/wik...rial%20Example

    Then I searched for a particular string in the message (that I set).

    I feel like there should be an easier / cleaner way to do this, but what I did worked for me.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to xur17 For This Useful Post:
    daperl, nicolai

     
    xur17 | # 13 | 2010-10-09, 19:57 | Report

    Does anyone know how to send a message to a user via a dbus command? It appears that I need to create a channel first, but I am at a loss on how to do this.

    This is what I have so far, but I am stuck after that:

    Code:
    bus = dbus.SessionBus()
    account = bus.get_object('org.freedesktop.Telepathy.AccountManager', '/org/freedesktop/Telepathy/Connection/theonering/gv/username_40gmail_2ecom/channel6')
    Do I need to do something like this?:

    Code:
    account.Set('org.freedesktop.Telepathy.Channel.Interface.Messages', 'Send', dbus.Struct(( dbus.UInt32(0) ,  presence_text,  ""), signature='uss'), dbus_interface='org.freedesktop.DBus.Properties')
    I am trying to use the example at the bottom of this page, but I am not sure how to adapt it to actually send a message to a user:

    http://wiki.maemo.org/Adventures_with_D-Bus

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by xur17; 2010-10-09 at 19:59.

     
    Page 2 of 2 | Prev |   1   2 |
vBulletin® Version 3.8.8
Normal Logout