Table of Contents

Class: Configlet ../../configlet.py

Main base class for configlets.

All configlets must inherit from this class. It provides various support functionality for hooking the configlet into the system, as well as helper functions and default values.

The procedure for writing a configlet involves inheriting from this class, and is documented separately.

Methods   
__init__
debug
error
get_description
get_display_title
get_name
get_packages
get_page_display_title
get_page_names
get_path
get_priority
get_shared_questions
get_widget
gnome_setup
load_debconf
on_gnome_close
report_debconf
validate
validate_page
warn
  __init__ 
__init__ ( self,  attr )

Initialize the configlet located in the provided directory.

  debug 
debug ( self,  message )

  error 
error ( self,  message )

  get_description 
get_description ( self )

Returns the description of the configlet.

  get_display_title 
get_display_title ( self )

Returns the configlet display title.

  get_name 
get_name ( self )

Returns the name of the configlet.

  get_packages 
get_packages ( self )

Returns the list of packages the configlet configures.

  get_page_display_title 
get_page_display_title ( self,  name )

Returns the display title associated with a page.

Exceptions   
IndexError, "page name %s not found" %( name, )
  get_page_names 
get_page_names ( self )

Returns the list of page names.

  get_path 
get_path ( self )

Returns the path to the directory containing the configlet.

  get_priority 
get_priority ( self )

Returns the configlet priority.

  get_shared_questions 
get_shared_questions ( self )

Returns the list of shared questions the configlet answers.

  get_widget 
get_widget ( self,  pagename="mainwidget" )

Returns the GTK widget for the particular page.

Exceptions   
IndexError, "page name %s not found" %( pagename, )
  gnome_setup 
gnome_setup ( self )

Gnome-related initialization.

Any graphical configuration (e.g. initializing widgets) should be done here, rather than in __init__.

If subclasses override this method, they must either replicate the functionality or call it themselves.

  load_debconf 
load_debconf ( self,  data )

Harvest appropriate info from the debconf database.

This function takes the debconf data passed and extracts appropriate items for use in setting the default values for the configlet. It should be overriden by derived classes to grab the appropriate data.

  on_gnome_close 
on_gnome_close ( self )

Notify the configlet that the front end is closing it.

This function gets called by the front end when the window containing the configlet is closing. The idea is that the configlet gets a chance to grab the current values from the UI before it goes away.

  report_debconf 
report_debconf ( self )

Returns the debconf information as modified by the user.

Once the configlet has been displayed, it should return the appropriate changes to the debconf values as the return value of this function.

One form of additional information may be returned in the list: Debconf flags. This is done by passing a string of the form "package/template package/question FLAGS:flag1,flag2" where flag1 and flag2 are the flags that should be set to true. Any number of flags may be set in this manner.

  validate 
validate ( self )

Validate the current information in the configlet.

This function validates all pages in the configlet at once. Single-page configlets can override this function or validate_page(); multi-page configlets should not override this.

  validate_page 
validate_page ( self,  pagename )

Validate a single page of information in the configlet.

Make sure that the data displayed in the given configlet page is valid. Multi-page configlets should override this method to implement real validity tests if possible.

  warn 
warn ( self,  message )


Table of Contents

This document was automatically generated on Mon Apr 15 13:20:44 2002 by HappyDoc version 2.0