Package pyvb :: Module vm :: Class vbVmParser
[hide private]
[frames] | no frames]

Class vbVmParser

source code

hdd.vbParser --+
               |
              vbVmParser

A parser for parsing the command line output for VirtualBox VMs.

Instance Methods [hide private]
pyvb.vbVmParser
__init__(self)
Constructor.
source code
List
parse(self, file)
Parse the given file.
source code
String
parseHddUUID(self, hdd)
Parse the specified HDD and return the uuid.
source code
Tuple
parseState(self, state)
Parse the specified machine state and return a tuple containing the state name, and the state date.
source code
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor. Initialize the found atributes dictionary which holds the attributes that are found and initialize the dictionary which contains the attribute we are looking for.

Returns: pyvb.vbVmParser
A new instance.

parse(self, file)

source code 

Parse the given file. For each VM that is found, we append the result to the list of returned VMs.

Parameters:
  • file (File) - The file object to parse.
Returns: List
The list of pyvb.vm.vbVM instances.

parseHddUUID(self, hdd)

source code 

Parse the specified HDD and return the uuid.

Parameters:
  • hdd (String) - The hdd string to parse.
Returns: String
The uuid of the specified HDD.

parseState(self, state)

source code 

Parse the specified machine state and return a tuple containing the state name, and the state date.

Parameters:
  • state (String) - The state string to parse.
Returns: Tuple
A tuple containing the state components.