| |
- pykickstart.ko.KickstartObject(__builtin__.object)
-
- BaseData
- BaseHandler
- KickstartCommand
-
- DeprecatedCommand
class BaseData(pykickstart.ko.KickstartObject) |
|
The base class for all data objects. This is an abstract class. |
|
- Method resolution order:
- BaseData
- pykickstart.ko.KickstartObject
- __builtin__.object
Methods defined here:
- __call__(self, *args, **kwargs)
- Set multiple attributes on a subclass of BaseData at once via
keyword arguments. Valid attributes are anything specified in a
subclass, but unknown attributes will be ignored.
- __init__(self, *args, **kwargs)
- Create a new BaseData instance.
lineno -- Line number in the ks-file where this object was defined
- __str__(self)
- Return a string formatted for output to a kickstart file.
- deleteRemovedAttrs(self)
- Remove all attributes from self that are given in the removedAttrs
list. This method should be called from __init__ in a subclass,
but only after the superclass's __init__ method has been called.
Data and other attributes defined here:
- removedAttrs = []
- removedKeywords = []
Data descriptors inherited from pykickstart.ko.KickstartObject:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class BaseHandler(pykickstart.ko.KickstartObject) |
|
Each version of kickstart syntax is provided by a subclass of this
class. These subclasses are what users will interact with for parsing,
extracting data, and writing out kickstart files. This is an abstract
class. |
|
- Method resolution order:
- BaseHandler
- pykickstart.ko.KickstartObject
- __builtin__.object
Methods defined here:
- __init__(self, mapping={}, dataMapping={}, commandUpdates={}, dataUpdates={}, *args, **kwargs)
- Create a new BaseHandler instance. This method must be provided by
all subclasses, but subclasses must call BaseHandler.__init__ first.
mapping -- A custom map from command strings to classes,
useful when creating your own handler with
special command objects. It is otherwise unused
and rarely needed. If you give this argument,
the mapping takes the place of the default one
and so must include all commands you want
recognized.
dataMapping -- This is the same as mapping, but for data
objects. All the same comments apply.
commandUpdates -- This is similar to mapping, but does not take
the place of the defaults entirely. Instead,
this mapping is applied after the defaults and
updates it with just the commands you want to
modify.
dataUpdates -- This is the same as commandUpdates, but for
data objects.
Instance attributes:
commands -- A mapping from a string command to a KickstartCommand
subclass object that handles it. Multiple strings can
map to the same object, but only one instance of the
command object should ever exist. Most users should
never have to deal with this directly, as it is
manipulated internally and called through dispatcher.
currentLine -- The current unprocessed line from the input file
that caused this handler to be run.
packages -- An instance of pykickstart.parser.Packages which
describes the packages section of the input file.
platform -- A string describing the hardware platform, which is
needed only by system-config-kickstart.
scripts -- A list of pykickstart.parser.Script instances, which is
populated by KickstartParser.addScript and describes the
%pre/%post/%traceback script section of the input file.
- __str__(self)
- Return a string formatted for output to a kickstart file.
- dispatcher(self, args, lineno, include=None)
- Call the appropriate KickstartCommand handler for the current line
in the kickstart file. A handler for the current command should
be registered, though a handler of None is not an error. Returns
the data object returned by KickstartCommand.parse.
args -- A list of arguments to the current command
lineno -- The line number in the file, for error reporting
include -- The path to any file %included immediately before the
current command
- hasCommand(self, cmd)
- Return true if there is a handler for the string cmd.
- maskAllExcept(self, lst)
- Set all entries in the commands dict to None, except the ones in
the lst. All other commands will not be processed.
Data and other attributes defined here:
- version = None
Data descriptors inherited from pykickstart.ko.KickstartObject:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class DeprecatedCommand(KickstartCommand) |
|
Specify that a command is deprecated and no longer has any function.
Any command that is deprecated should be subclassed from this class,
only specifying an __init__ method that calls the superclass's __init__.
This is an abstract class. |
|
- Method resolution order:
- DeprecatedCommand
- KickstartCommand
- pykickstart.ko.KickstartObject
- __builtin__.object
Methods defined here:
- __init__(self, writePriority=None, *args, **kwargs)
- __str__(self)
- Placeholder since DeprecatedCommands don't work anymore.
- parse(self, args)
- Print a warning message if the command is seen in the input file.
Methods inherited from KickstartCommand:
- __call__(self, *args, **kwargs)
- Set multiple attributes on a subclass of KickstartCommand at once
via keyword arguments. Valid attributes are anything specified in
a subclass, but unknown attributes will be ignored.
- apply(self, instroot='/')
- Write out the configuration related to the KickstartCommand object.
Subclasses which do not provide this method will not have their
configuration written out.
- dataList(self)
- For commands that can occur multiple times in a single kickstart
file (like network, part, etc.), return the list that we should
append more data objects to.
- deleteRemovedAttrs(self)
- Remove all attributes from self that are given in the removedAttrs
list. This method should be called from __init__ in a subclass,
but only after the superclass's __init__ method has been called.
Data and other attributes inherited from KickstartCommand:
- removedAttrs = []
- removedKeywords = []
Data descriptors inherited from pykickstart.ko.KickstartObject:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class KickstartCommand(pykickstart.ko.KickstartObject) |
|
The base class for all kickstart commands. This is an abstract class. |
|
- Method resolution order:
- KickstartCommand
- pykickstart.ko.KickstartObject
- __builtin__.object
Methods defined here:
- __call__(self, *args, **kwargs)
- Set multiple attributes on a subclass of KickstartCommand at once
via keyword arguments. Valid attributes are anything specified in
a subclass, but unknown attributes will be ignored.
- __init__(self, writePriority=0, *args, **kwargs)
- Create a new KickstartCommand instance. This method must be
provided by all subclasses, but subclasses must call
KickstartCommand.__init__ first. Instance attributes:
currentCmd -- The name of the command in the input file that
caused this handler to be run.
currentLine -- The current unprocessed line from the input file
that caused this handler to be run.
handler -- A reference to the BaseHandler subclass this
command is contained withing. This is needed to
allow referencing of Data objects.
lineno -- The current line number in the input file.
writePriority -- An integer specifying when this command should be
printed when iterating over all commands' __str__
methods. The higher the number, the later this
command will be written. All commands with the
same priority will be written alphabetically.
- __str__(self)
- Return a string formatted for output to a kickstart file. This
method must be provided by all subclasses.
- apply(self, instroot='/')
- Write out the configuration related to the KickstartCommand object.
Subclasses which do not provide this method will not have their
configuration written out.
- dataList(self)
- For commands that can occur multiple times in a single kickstart
file (like network, part, etc.), return the list that we should
append more data objects to.
- deleteRemovedAttrs(self)
- Remove all attributes from self that are given in the removedAttrs
list. This method should be called from __init__ in a subclass,
but only after the superclass's __init__ method has been called.
- parse(self, args)
- Parse the list of args and set data on the KickstartCommand object.
This method must be provided by all subclasses.
Data and other attributes defined here:
- removedAttrs = []
- removedKeywords = []
Data descriptors inherited from pykickstart.ko.KickstartObject:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |