[tpm] DBus woes

Digimer linux at alteeve.com
Thu Jan 27 17:29:23 PST 2011


On 01/27/2011 03:19 PM, Scott Elcomb wrote:
> Hi all,
> 
> I'd like to start working with Desktop Couch[1], the DBus + CouchDB
> service behind Ubuntu One[2].
> 
> As I haven't really worked with DBus before I'm a bit stuck; before I
> go off to bug the desktopcouch list I'd like to make sure I understand
> the Perl side of the issue.
> 
> Here's a really simple little script that is supposed to retrieve the
> port # on which the current user's desktopcouch instance is listening.
> 
> [-- sample starts --]
> #!/usr/bin/env perl
> 
> use strict;
> use warnings;
> use Net::DBus;
> 
> # shell example:
> #   dbus-send --session \
> #   --dest=org.desktopcouch.CouchDB \
> #   --print-reply \
> #   --type=method_call / org.desktopcouch.CouchDB.getPort
> 
> my $port_number = -1;
> 
> my $svc_object = Net::DBus->session
>     ->get_service('org.desktopcouch.CouchDB')
>     ->get_object('/org/desktopcouch/CouchDB')
> ;
> 
> # Doesn't work because $svc_object has no interface
> # $port_number = $svc_object->getPort();
> 
> print "Desktop CouchDB is running on port: $port_number\n";
> [-- sample ends --]
> 
> The desktopcouch specs page[1] refers developers to couchdb-glib[3]
> and (for Perl devs) to Glib::Object::Introspection[4].  On the surface
> it looks to me like [4] should fix the missing interface issue but I'm
> unsure on how to proceed... I much prefer working with pure perl
> modules and have never needed to wrap a C library before.
> 
> Any help or pointers would be most appreciated.
> 
> Thanks,
> - Scott.
> 
> 
> [1] <http://freedesktop.org/wiki/Specifications/desktopcouch>
> [2] <https://one.ubuntu.com/>
> [3] <https://launchpad.net/couchdb-glib>
> [4] <http://live.gnome.org/GTK2-Perl/Introspection>

http://wiki.alteeve.com/index.php/TPM_Talk:_An_Introduction_to_%27D-Bus%27_in_Perl

http://wiki.alteeve.com/index.php/Net::DBus_Binding_Tutorial

:)

-- 
Digimer
E-Mail: digimer at alteeve.com
AN!Whitepapers: http://alteeve.com
Node Assassin:  http://nodeassassin.org


More information about the toronto-pm mailing list