Main Python interface to configlet infrastructure.
Imported modules
|
|
import copy
import os
import re
import string
import sys
import time
import traceback
import types
|
Functions
|
|
|
|
_debconf_communicate
|
_debconf_communicate ( package, s )
Not only does this make the debconf-communicate code cleaner and
simpler, it protects us from a bug discovered during PGI development
wherein debconf-communicate doesn't always react well to more than
one line of input. See its man page synopsis for a hint.
|
|
check_attributes
|
check_attributes ( attributes )
Exceptions
|
|
TypeError, "description must be a string"
TypeError, "display_title must be a string"
TypeError, "no title supplied for page %s" % page_name
TypeError, "packages must be a list"
TypeError, "page_display_titles must be a dictionary"
TypeError, "page_names must be a list"
TypeError, "priority must be an integer"
TypeError, "shared_questions must be a list"
|
|
|
debug
|
debug ( identifier, message )
|
|
error
|
error ( identifier, message )
|
|
get_debconf
|
get_debconf ( pkglist )
Instantiate the proper DebConf object.
This should be called by the config group; it's recommended to
just ask your config group for the debconf object if you need it.
|
|
load_configlet
|
load_configlet ( path )
Loads a configlet's class into the system
Takes one argument: the directory that contains main.py
Exceptions
|
|
RuntimeError, "path %s does not contain a configlet" %( path, )
RuntimeError, "path %s does not exist" %( path, )
|
|
|
load_gnome
|
load_gnome ()
|
|
make_temp_dir
|
make_temp_dir ()
Exceptions
|
|
RuntimeError, "could not create temporary directory"
|
|
|
print_traceback
|
print_traceback ()
|
|
privileged_run
|
privileged_run ( command )
Run a command with privilege.
This runs a command using the current privileged runner class,
or just tries to run the command if no privileged runner class
has been set.
Exceptions
|
|
RuntimeError, "Command %s failed to execute, status %X" %( command, retval )
|
|
|
register_configlet
|
register_configlet ( configlet, attributes )
Registers the configlet class with the configlet system.
|
|
set_privileged_runner
|
set_privileged_runner ( runner )
|
|
start_configlet
|
start_configlet ( path )
Return the configlet object found at the particular path.
This ensures that only one of each configlet will be started.
It takes the path where the configlet's files are stored. If
the configlet has already been started, it will return the
current instance. If not, it will start it. If there's a
problems (such as the attributes being invalid), it will return
None.
|
|
warn
|
warn ( identifier, message )
|
Classes
|
|
|