Package PyFoam :: Package Basics :: Module Utilities :: Class Utilities
[hide private]
[frames] | no frames]

Class Utilities

source code

object --+
         |
        Utilities
Known Subclasses:
RunDictionary.FileBasis.FileBasis, RunDictionary.SolutionDirectory.SolutionDirectory, Execution.ParallelExecution.LAMMachine

Class with utility methods

Can be inherited without side effects by classes that need these methods

Instance Methods [hide private]
  __init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  execute(self, cmd, debug=False)
Execute the command cmd
  writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary
  listDirectory(self, d)
Lists the files in a directory, but excludes certain names and files with certain endings

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


Class Variables [hide private]
  excludeNames = ['^.svn$', '~$']

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

execute(self, cmd, debug=False)

source code 

Execute the command cmd

Currently no error-handling is done
Returns:
A list with all the output-lines of the execution

writeDictionaryHeader(self, f)

source code 
Writes a dummy header so OpenFOAM accepts the file as a dictionary
Parameters:
  • f (file) - The file to write to

listDirectory(self, d)

source code 
Lists the files in a directory, but excludes certain names and files with certain endings
Parameters:
  • d - The directory to list
Returns:
List of the found files and directories

Class Variable Details [hide private]

excludeNames

None
Value:
['^.svn$', '~$']