Re: VPN Plugin in python



On Sun, 2009-03-29 at 21:43 +0400, Alex Dorokhov wrote:
> Hello! I would like to write a vpn-plugin for Network Manager. Is it
> possible to use Python for this?

Mostly; all communication between NM and the plugin itself is done via
D-Bus, which is quite easy to do in Python.  There are actually 3 parts
to a plugin:

1) the actual VPN service wrapper itself
2) the auth-dialog, shown when a password is needed before connecting
3) the properties page, shown in the connection editor when configuring
the connection

(1) uses D-Bus for all communication, (2) is simply a program that
nm-applet spawns, and the applet reads the stdout of that program.

(3) could be a bit tricky, since these are expected to be a shared
object that can be loaded with GModule calls.  I believe it would still
be possible to write the properties page in Python and use a small C
wrapper for the GModule bits though.

But in the end, 2/3 or more would be Python, the rest could be C if
you're lazy, or almost all Python if you're not :)

Dan




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