rox.su
index

The su (switch user) module allows you to execute a command as some
other user (normally 'root'). It supports a variety of methods to perform
the switch (using su, xsu, sudo, etc) so you don't have to worry about
which ones are available on the current platform.

 
Classes
       
rox.Dialog(gtk.Dialog)
SwitchDialog
Method
PtyMethod
XtermMethod
XtermMethod
Pipe

 
class Method
       
  Methods defined here:
__init__(self, uid)
add_interaction_ui(self, box)
get_master(self)

 
class Pipe
      Contains Python file objects for two pipe ends.
Wrapping the FDs in this way ensures that they will be freed on error.
 
  Methods defined here:
__init__(self)

 
class PtyMethod(Method)
       
  Methods defined here:
__init__(self, uid)
add_interaction_ui(self, box)
done_interaction(self, box)
finish(self)
get_master(self)

 
class SwitchDialog(rox.Dialog)
       
  Methods defined here:
__init__(self, message, method)
do_interaction(self)
get_password(self)
set_password_prompt(self, message)

 
class XtermMethod(Method)
       
  Methods defined here:
exec_child(self, to_parent, from_parent)
get_master(self)

 
default_method = class XtermMethod(Method)
       
  Methods defined here:
exec_child(self, to_parent, from_parent)
get_master(self)

 
Functions
       
create_su_proxy(message, uid=0, confirm=True)
Creates a new proxy object and starts the child process.
If necessary, the user is prompted for a password. If no
password is required, the user is simply asked to confirm,
unless 'confirm' is False.
Raises UserAbort if the user clicks Cancel.
select(...)
select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)
 
Wait until one or more file descriptors are ready for some kind of I/O.
The first three arguments are lists of file descriptors to be waited for:
rlist -- wait until ready for reading
wlist -- wait until ready for writing
xlist -- wait for an ``exceptional condition''
If only one kind of condition is required, pass [] for the other lists.
A file descriptor is either a socket or file object, or a small integer
gotten from a fileno() method call on one of those.
 
The optional 4th argument specifies a timeout in seconds; it may be
a floating point number to specify fractions of seconds.  If it is absent
or None, the call will never time out.
 
The return value is a tuple of three lists corresponding to the first three
arguments; each contains the subset of the corresponding file descriptors
that are ready.
 
*** IMPORTANT NOTICE ***
On Windows, only sockets are supported; on Unix, all file descriptors.