Package PyFoam :: Package Applications :: Module PyFoamApplication :: Class PyFoamApplication
[hide private]
[frames] | no frames]

Class PyFoamApplication

source code


This class is the base for all pyFoam-utilities

Nested Classes [hide private]
  iDict
This class is a quick and dirty wrapper to use a dictionary like a struct
Instance Methods [hide private]
 
__getattr__(self, key) source code
 
__getitem__(self, key)
Get application data
source code
 
__init__(self, args=None, description=None, epilog=None, examples=None, usage=None, interspersed=False, nr=None, changeVersion=True, exactNr=True, subcommands=None, inputApp=None, **kwArgs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__iter__(self)
Iterate over the application data
source code
 
__setitem__(self, key, value)
Set data.
source code
 
addLocalConfig(self, directory=None)
Adds a local directory (assuming it is found)
source code
 
addOptions(self)
Add options to the parser
source code
 
addToCaseLog(self, name, *text)
Add information about the application that was run to the case-log
source code
 
checkCase(self, name, fatal=True, verbose=True)
Check whether this is a valid OpenFOAM-case
source code
 
ensureGeneralOptions(self) source code
 
error(self, *args)
Raise a error exception.
source code
 
errorPrint(self, *args)
Prints an error message and exits
source code
 
getData(self)
Get the application data
source code
 
iteritems(self) source code
 
iterkeys(self) source code
 
run(self)
Run the real application
source code
 
setData(self, data)
Set the application data
source code
 
silent(self, *args)
Don't print a warning message
source code
 
warning(self, *args)
Prints a warning message
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, args=None, description=None, epilog=None, examples=None, usage=None, interspersed=False, nr=None, changeVersion=True, exactNr=True, subcommands=None, inputApp=None, **kwArgs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • description - description of the command
  • epilog - text to be printed after the options-help
  • examples - usage examples to be printed after the epilog
  • usage - Usage
  • interspersed - Is the command line allowed to be interspersed (options after the arguments)
  • args - Command line arguments when using the Application as a 'class' from a script
  • nr - Number of required arguments
  • changeVersion - May this application change the version of OF used?
  • exactNr - Must not have more than the required number of arguments
  • subcommands - parse and use subcommands from the command line. Either True or a list with subcommands
  • inputApp - Application with input data. Used to allow a 'pipe-like' behaviour if the class is used from a Script
Overrides: object.__init__

__setitem__(self, key, value)
(Index assignment operator)

source code 

Set data. Only if key does not exist (data can only be set once)

checkCase(self, name, fatal=True, verbose=True)

source code 

Check whether this is a valid OpenFOAM-case

Parameters:
  • name - the directory-bame that is supposed to be the case
  • fatal - If this is not a case then the application ends
  • verbose - If this is not a case no warning is issued

error(self, *args)

source code 

Raise a error exception. How it will be handled is a different story

Parameters:
  • args - Arguments to the exception

errorPrint(self, *args)

source code 

Prints an error message and exits

Parameters:
  • args - Arguments that are to be printed

setData(self, data)

source code 

Set the application data

Parameters:
  • data - dictionary whose entries will be added to the application data (possibly overwriting old entries of the same name)

silent(self, *args)

source code 

Don't print a warning message

Parameters:
  • args - Arguments that are to be printed

warning(self, *args)

source code 

Prints a warning message

Parameters:
  • args - Arguments that are to be printed