Package PyFoam :: Package RunDictionary :: Module FileBasis :: Class FileBasis
[show private | hide private]
[frames | no frames]

Class FileBasis

Utilities --+
            |
           FileBasis

Known Subclasses:
FileBasisBackup, SolutionFile

Base class for the other OpenFOAM--file-classes
Method Summary
  __init__(self, name)
name - Name of the file
  closeFile(self)
closes the file
  copyRest(self, l, out)
Copy the rest of the file
  goMatch(self, l, exp, out)
Read lines until a regular expression is matched
  goTo(self, l, s, out, echoLast)
Read lines until a token is found
  makeTemp(self)
creates a temporary file
  openFile(self)
opens the file.
  purgeFile(self)
Undo all the manipulations done by PyFOAM
    Inherited from Utilities
  execute(self, cmd)
Execute the command cmd
  writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary

Class Variable Summary
str addedString = '//PyFoamAdded'
str removedString = '//PyFoamRemoved: '

Method Details

__init__(self, name)
(Constructor)

name - Name of the file
Overrides:
PyFoam.Basics.Utilities.Utilities.__init__

closeFile(self)

closes the file

copyRest(self, l, out)

Copy the rest of the file

l - a LineReader object out - filehandle to echo the lines to

goMatch(self, l, exp, out=None)

Read lines until a regular expression is matched

l - a LineReader object exp - the expression to look for out - filehandle to echo the lines to

goTo(self, l, s, out=None, echoLast=False)

Read lines until a token is found

l - a LineReader object s - the string to look for out - filehandle to echo the lines to echoLast - echo the line with the string

makeTemp(self)

creates a temporary file

openFile(self)

opens the file. To be overloaded by derived classes

purgeFile(self)

Undo all the manipulations done by PyFOAM

Goes through the file and removes all lines that were added

Class Variable Details

addedString

Type:
str
Value:
'//PyFoamAdded'                                                        

removedString

Type:
str
Value:
'//PyFoamRemoved: '                                                    

Generated by Epydoc 2.1 on Fri Jan 13 15:23:06 2006 http://epydoc.sf.net