Table of Contents

Class: ssh src/backend.py

SSH the GUI way! Inherits an AuthDialog from the dialogs module and to prompt the user. Uses a pxssh from pexpect 2.x to control a single SSH session for the entire run. (A second ssh runs for the prefs window.) This is how we handle printers on remote CUPS servers.

Methods   
__init__
get_output
get_password
get_port
get_ssh_auth
get_use_key
logout
show_all
  __init__ 
__init__ (
        self,
        hostname,
        username=None,
        password=None,
        )

Prompts the user for a username and password (if not supplied). It extends AuthDialog.__init___ by adding a msg, expander, port entry box and a Use key-based authentication gtk.CheckButton.

  get_output 
get_output ( self,  command )

Runs a single command in the SSH session and waits for the prompt to return and then returns the output

  get_password 
get_password ( self )

Return the password from the dialog or from the creds dictionary in the conf instance, config, if present.

  get_port 
get_port ( self )

Returns the port as a string if specified by the user or 22, if none.

  get_ssh_auth 
get_ssh_auth ( self )

Displays the dialog only if the credentials aren't in the config.creds dictionary. Returns the username and password. If the dialog gets displayed, this method will capture the creds dictionary and write it out to the stored configuration file. Finally, it uses the credentials obtained to login to the remote system via the pxssh.login() method.

  get_use_key 
get_use_key ( self )

Returns the status of the "use key-based authentication" gtk.CheckButton

  logout 
logout ( self )

Logout of the SSH session. Just calls pxssh.logout()

  show_all 
show_all ( self )

Extends the show_all method of AuthDialog to pack the additional controls


Table of Contents

This document was automatically generated on Sun Feb 3 17:55:12 2008 by HappyDoc version 2.1