| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.6/site-packages/firstboot/ |
Upload File : |
Ñò
µBÖJc @ sL d d k Td d k Td d k Z d d k Z d „ Z d d d „ ƒ YZ d S( iÿÿÿÿ( t *Nc C s t i d | ƒ S( t firstboot( t gettextt ldgettext( t x( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt <lambda> s t Modulec B sb e Z d Z d „ Z e d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z RS(
sÈ The base class for all firstboot modules. A firstboot module is a
single screen that is presented during the first bootup of the system.
A single module is used for asking a single question or several related
questions, or for configuring one individual system component.
This is an abstract class. All firstboot modules should subclass this
one and define the following attributes and methods as described below.
c C sW | i t j o
t d ‚ n d | _ t | _ d | _ d | _ d | _ d | _
d S( sU Create a new Module instance. This method must be provided by
all subclasses. Of the following instance attributes, only icon
is not required. The module loader will check that all required
attributes are present and defined. Instance attributes;
icon -- No longer used.
mode -- The mode of firstboot operation that this module
should appear in. MODE_REGULAR means the module
will appear only in the regular running mode.
MODE_RECONFIG means the module will appear in both
regular mode and reconfig mode.
priority -- An integer specifying the order in which this module
should be loaded and appear in firstboot. The lower
the priority number, the earlier this module will
be loaded and run. All modules with the same
priority will then be ordered alphabetically by
title.
sidebarTitle -- A brief word or phrase that will appear on the
firstboot sidebar on the left side of the screen.
title -- The title of the module that will appear on the
right side of the screen above the module when it
is displayed. The title is shown in large bold
letters.
vbox -- A gtk.VBox that contains all the widgets for this
module. The vbox will be wrapped in various other
widgets to present a consistent look and placed
on the right side of the screen when the module is
displayed.
s Module is an abstract class.i N( t __class__R t TypeErrort Nonet icont MODE_REGULARt modet priorityt sidebarTitlet titlet vbox( t self( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt __init__$ s
c C s
t d ‚ d S( sŽ Called when the Next button is clicked on the interface. This
method takes whatever action is appropriate based on the state
of the UI. This can include writing things to disk or running
programs. apply should return one of the following values:
RESULT_FAILURE -- Return this value if firstboot should not move
to the next screen. This is commonly used when
a module displays a yes/no question, and the user
selects no so the module must present its screen
again.
RESULT_SUCCESS -- Return this value if everything worked. This
tells firstboot that it should advance to the
next module.
RESULT_JUMP -- Return this value if the module called
interface.moveToPage. This tells firstboot to
not automatically advance to the next module.
Otherwise, the page your module advanced to will
be skipped.
This method must be provided by all subclasses. Arguments:
interface -- A reference to the running Interface class.
testing -- If True, this method must not make any permanent
changes to disk.
s# apply() not implemented for Module.N( t NotImplementedError( R t interfacet testing( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt applyM s c C s
t d ‚ d S( s“ Create a new instance of gtk.VBox, the UI elements required for
this module, and pack them into self.vbox. Do not take any action
to initialize the UI elements or write anything to disk. This
method does not return any value, and is the first method called on
a module after it is loaded. This method must be provided by all
subclasses.
s* createScreen() not implemented for Module.N( R ( R ( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt createScreeni s c C s d S( sm Focus some initial UI element on the page. This method is called
immediately after the UI is initialized and before it is displayed
on the screen. If the module requires that some UI element besides
the Next button be focused by default, the module should override
this method. Otherwise, nothing will be done.
N( ( R ( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt focuss s c C s
t d ‚ d S( s¦ Synchronize the state of the UI with whatever's present on disk
or wherever else the module looks for its default values. This
method will be called immediately before the module is displayed,
both when moving forwards and backwards through the module list.
It should be designed to be called multiple times. This method
must be provided by all subclasses.
s* initializeUI() not implemented for Module.N( R ( R ( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt initializeUI| s c C s t S( s. Does this module require the network to be active in order to run?
By default, no modules need networking. If the module requires
networking which is not available, the module will not be presented.
Modules that require networking should override this method.
( t False( R ( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt needsNetwork† s c C s t S( s Does whatever action happened in this module's apply() method
require rebooting the computer? By default, no modules require
rebooting. Modules that require the system to be rebooted for
their changes to take effect should override this method.
( R ( R ( ( s4 /usr/lib/python2.6/site-packages/firstboot/module.pyt needsRebootŽ s c C sà | i d j o( t i d | i ƒ t d | i ‚ n d d k } d d k l } | i d ƒ } | i
d d ƒ | i d t | i ƒ ƒ | i
ƒ } | i | t ƒ | i d
ƒ | i i | t ƒ | i i | d ƒ d S( sŒ Wrap the module's top-level UI element in the other elements
required to make sure all modules have the same common look. This
method is called immediately after createScreen() and requires that
self.vbox be initialized. Modules should not override this method.
Arguments:
interface -- A reference to the running Interface class.
s$ Module %s has not initialized its UIs$ Module %s has not initializes its UIiÿÿÿÿN( t loadToImaget g g à?sP <span foreground='#000000' size='30000' font_family='Helvetica'><b>%s</b></span>i i ( R R t loggingt errorR t SystemErrort gtkt firstboot.functionsR t Labelt
set_alignmentt
set_markupt _t HBoxt
pack_startt Truet set_spacingR t
reorder_child( R R R"