RE: removing a connection from python - stuck

Ok, The familiar "finding the solution soon after posting" happened again.

I finally after many hours made some sense of the code. I am afraid I have collected code from so many samples the result is almost unreadable.
Time to clean up.

Anyway the solution is of course that I need to create an interface (and use capital D on delete....)

        con_proxy = bus.get_object(service_name, path)
        settings_connection = dbus.Interface(con_proxy, "org.freedesktop.NetworkManager.Settings.Connection")


From: jonas_vikstrom hotmail com
To: networkmanager-list gnome org
Subject: removing a connection from python - stuck
Date: Sat, 5 May 2012 19:55:22 +0000

I am completely stuck again. I really hope some one can give me a hint.
I can do most of the basic operations from python now but I cant figure out how to delete a connection.

I would like to use the connection.delete() method but all "connections" I can find seem to be paths and not really the connection object.
I have no clue how to deal with that.

    service_name = "org.freedesktop.NetworkManager"
    proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager/Settings")
    settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings")
    conn = settings.GetConnectionByUuid(uuid)

AttributeError: 'dbus.ObjectPath' object has no attribute 'delete'

am I on the wrong track or what do I miss?

best regards, Jonas

_______________________________________________ networkmanager-list mailing list networkmanager-list gnome org

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