rox.su
index

The su (switch user) module allows you to execute commands as root.
Typical usage:
 
def fn():
        proxy_maker = SuProxyMaker('I need root access to change /etc/fstab')
        yield proxy_maker.blocker
        root = proxy_maker.get_root()
 
        call = root.open('/etc/fstab')
        yield call
        fd = call.result
 
        ...
 
        root.finish()
 
tasks.Task(fn())
 
See rox.suchild for a list of operations available on the 'root' object.

 
Classes
       
rox.tasks.Blocker
SuProxyMaker

 
class SuProxyMaker(rox.tasks.Blocker)
       
  Methods defined here:
__init__(self, message)
Displays a box prompting the user for a password.
Creates a new master_proxy.MasterObject and starts the child
process. The user is prompted for the root
password.
get_root(self)
Raises UserAbort if the user cancels.

 
Functions
       
get_term_command()