The Volatility Framework
volatility.conf.ConfObject Class Reference

This is a singleton class to manage the configuration. More...

Inheritance diagram for volatility.conf.ConfObject:
volatility.conf.DummyConfig

Public Member Functions

def __init__ (self)
 This is a singleton object kept in the class.
 
def set_usage
 
def add_file
 Adds a new file to parse.
 
def print_help (self)
 
def add_help_hook (self, cb)
 Adds an epilog to the help message.
 
def set_help_hook (self, cb)
 
def parse_options
 Parses the options from command line and any conf files currently added. More...
 
def remove_option (self, option)
 Removes options both from the config file parser and the command line parser. More...
 
def add_option (self, option, short_option=None, cache_invalidator=True, args)
 Adds options both to the config file parser and the command line parser. More...
 
def update (self, key, value)
 This can be used by scripts to force a value of an option.
 
def get_value (self, key)
 
def __getattr__ (self, attr)
 

Public Attributes

 opts
 If someone is looking for a configuration parameter but we have not parsed anything yet - do so now. More...
 

Static Public Attributes

tuple optparser
 
 initialised = False
 
tuple g_dict = dict(__builtins__ = None)
 This is the globals dictionary which will be used for evaluating the configuration directives. More...
 
dictionary cnf_opts = {}
 These are the options derived by reading any config files.
 
dictionary opts = {}
 Command line opts.
 
 args = None
 
dictionary default_opts = {}
 
dictionary docstrings = {}
 
 optparse_opts = None
 These are the actual options returned by the optparser: More...
 
dictionary readonly = {}
 These parameters can not be updated by the GUI (but will be propagated into new configuration files)
 
list options = []
 A list of option names:
 
dictionary cache_invalidators = {}
 Cache variants: There are configuration options which encapsulate the state of the running program. More...
 

Detailed Description

This is a singleton class to manage the configuration.

This means it can be instantiated many times, but each instance refers to the global configuration (which is set in class variables).

NOTE: The class attributes have static dicts assigned to facilitate singleton behaviour. This means all future instances will have the same dicts.

Member Function Documentation

def volatility.conf.ConfObject.add_option (   self,
  option,
  short_option = None,
  cache_invalidator = True,
  args 
)

Adds options both to the config file parser and the command line parser.

Args: option: The long option name. short_option: An optional short option. cache_invalidator: If set, when this option changes all caches are invalidated.

def volatility.conf.ConfObject.parse_options (   self,
  final = True 
)

Parses the options from command line and any conf files currently added.

The final parameter should be only called from main programs at the point where they are prepared for us to call exit if required; (For example when we detect the -h parameter).

def volatility.conf.ConfObject.remove_option (   self,
  option 
)

Removes options both from the config file parser and the command line parser.

This should only by used on options before they have been read, otherwise things could get very confusing.

Member Data Documentation

dictionary volatility.conf.ConfObject.cache_invalidators = {}
static

Cache variants: There are configuration options which encapsulate the state of the running program.

If any of these change all caches will be invalidated.

tuple volatility.conf.ConfObject.g_dict = dict(__builtins__ = None)
static

This is the globals dictionary which will be used for evaluating the configuration directives.

volatility.conf.ConfObject.optparse_opts = None
static

These are the actual options returned by the optparser:

Parse the command line options:

Update our cmdline dict: If error() was called we catch it here This gives us as much as was parsed so far

tuple volatility.conf.ConfObject.optparser
static
Initial value:
1 = PyFlagOptionParser(add_help_option = False,
2  version = False,
3  )
volatility.conf.ConfObject.opts

If someone is looking for a configuration parameter but we have not parsed anything yet - do so now.


The documentation for this class was generated from the following file: