examples/python/NetworkManager.py (was: No dhclient started for wireless card)



Darren Albers wrote:

> There is a listing of all the api's used in the source tarball under
> docs and an example (using python) under docs.

Thanks!  That looks pretty cool -- I was thinking about writing a Python
script indeed.

So I tried the NetworkManager.py module from the 0.6.5 release:

http://svn.gnome.org/viewcvs/NetworkManager/tags/NETWORKMANAGER_0_6_5_RELEASE/examples/python/NetworkManager.py?view=markup

Unfortunately, it seems to use an outdated version of the dbus
interface.  I'm attaching the output of "python NetworkManager.py".
(I'm using Debian's python-dbus 0.80.2-2.)

I quickly googled up this message about the interface change:
http://lists.freedesktop.org/archives/dbus/2006-July/005298.html
Right now I don't have time to look into it in more detail (since I'm
not a dbus expert).

If anyone can look into updating NetworkManager.py (or tell me what I'm
doing wrong), I'd be very curious to hear about it.

// Lea
NetworkManager.py:4: DeprecationWarning: The dbus_bindings module is deprecated and will go away soon.

dbus-python 0.80 provides only a partial emulation of the old
dbus_bindings, which was never meant to be public API.

Most uses of dbus_bindings are applications catching the exception
dbus.dbus_bindings.DBusException. You should use dbus.DBusException
instead (this is compatible with all dbus-python versions since 0.40.2).

If you need additional public API, please contact the maintainers via
<dbus lists freedesktop org>.

  from  dbus_bindings import DBusException
/var/lib/python-support/python2.4/dbus_bindings.py:5: DeprecationWarning: The dbus_bindings module is deprecated and will go away soon.

dbus-python 0.80 provides only a partial emulation of the old
dbus_bindings, which was never meant to be public API.

Most uses of dbus_bindings are applications catching the exception
dbus.dbus_bindings.DBusException. You should use dbus.DBusException
instead (this is compatible with all dbus-python versions since 0.40.2).

If you need additional public API, please contact the maintainers via
<dbus lists freedesktop org>.

  from dbus.dbus_bindings import *
Counldn't get the org.freedesktop.NetworkManager service
'SystemBus' object has no attribute 'get_service'
Counldn't get the org.freedesktop.NetworkManagerInfo service
'SystemBus' object has no attribute 'get_service'
Counldn't get the org.freedesktop.Hal service
'SystemBus' object has no attribute 'get_service'


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