Package pywbem :: Module mof_compiler :: Class MOFCompiler
[frames] | no frames]

Class MOFCompiler

source code

object --+
         |
        MOFCompiler

MOF compiler class. Initializes the compiler and includes functions to compile input files
Instance Methods
 
__init__(self, handle, search_paths=[], verbose=False, log_func=<function _print_logger at 0x2b6e13271de8>)
Initialize the compiler.
source code
 
compile_file(self, filename, ns)
Compile MOF from a file.
source code
 
compile_string(self, mof, ns, filename=None)
Compile a string of MOF.
source code
 
find_mof(self, classname)
search_paths provided to __init__() are searched recursively.
source code
 
rollback(self, verbose=False)
Rollback/delete objects created within the context of this MOFCompiler instance
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, handle, search_paths=[], verbose=False, log_func=<function _print_logger at 0x2b6e13271de8>)
(Constructor)

source code 
Initialize the compiler.

Keyword arguments:
handle -- A WBEMConnection or similar object.  The following
    attributes and methods need to be present, corresponding to the
    the attributes and methods on pywbem.WBEMConnection having
    the same names:
    - default_namespace
    - EnumerateInstanceNames()
    - CreateClass()
    - GetClass()
    - ModifyClass()
    - DeleteInstance()
    - CreateInstance()
    - ModifyInstance()
    - DeleteQualifier()
    - EnumerateQualifiers()
    - SetQualifier()
search_paths -- A list of file system paths specifying where
    missing schema elements should be looked for.
verbose -- True if extra messages should be printed.
log_func -- A callable that takes a single string argument.
    The default logger prints to stdout.

Overrides: object.__init__

compile_file(self, filename, ns)

source code 

Compile MOF from a file.

Arguments: filename -- The file to read MOF from ns -- The CIM namespace

compile_string(self, mof, ns, filename=None)

source code 
Compile a string of MOF.

Arguments:
mof -- The string of MOF
ns -- The CIM namespace

Keyword arguments:
filename -- The name of the file that the MOF was read from.  This
    is used in status and error messages.

find_mof(self, classname)

source code 
Find a MOF file corresponding to a CIM class name. The
search_paths provided to __init__() are searched recursively.

Arguments: classname -- The name of the class to look for