Package PyFoam :: Package RunDictionary :: Module ParsedParameterFile :: Class ParsedBoundaryDict
[hide private]
[frames] | no frames]

Class ParsedBoundaryDict

source code


Convenience class that parses only a OpenFOAM polyMesh-boundaries file

Instance Methods [hide private]
 
__init__(self, name, treatBinaryAsASCII=False, backup=False, debug=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__str__(self)
Generates a string from the contents in memory Used to be called makeString
source code
 
parse(self, content)
Constructs a representation of the file
source code

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

    Inherited from ParsedParameterFile
 
__contains__(self, key) source code
 
__delitem__(self, key) source code
 
__getitem__(self, key) source code
 
__iter__(self) source code
 
__len__(self) source code
 
__setitem__(self, key, value) source code
 
getValueDict(self)
Get a dictionary with the values with the decorators removed
source code
    Inherited from FileBasis.FileBasisBackup
 
restore(self)
if a backup-copy was made the file is restored from this
source code
    Inherited from FileBasis.FileBasis
 
baseName(self)
Returns the basic file name (without .gz)
source code
 
closeFile(self)
closes the file
source code
 
copyRest(self, l, out)
Copy the rest of the file
source code
 
encode(self, txt)
Encode a string to byte if necessary (for Python3)
source code
 
getCaseDir(self)
Return the path to the case of this file (if any valid case is found).
source code
 
goMatch(self, l, exp, out=None, stop=None)
Read lines until a regular expression is matched
source code
 
goTo(self, l, s, out=None, echoLast=False, stop=None)
Read lines until a token is found
source code
 
makeTemp(self)
creates a temporary file
source code
 
openFile(self, keepContent=False, mode='r')
opens the file.
source code
 
purgeFile(self)
Undo all the manipulations done by PyFOAM
source code
 
readFile(self)
read the whole File into memory
source code
 
realName(self)
The full filename with appended .gz (if zipped)
source code
 
writeEncoded(self, out, txt)
Convert the text to 'bytes' is we encounter a zipped file
source code
 
writeFile(self, content=None)
write the whole File from memory
source code
 
writeFileAs(self, name)
Writes a copy of the file.
source code
    Inherited from Basics.Utilities.Utilities
 
copyfile(self, src, dst)
Encapsulates the shutil copyfile and provides an alternative for old Python-version
source code
 
copytree(self, src, dst, symlinks=False)
Encapsulates the shutil copytree and provides an alternative for old Python-version
source code
 
execute(self, cmd, debug=False)
Execute the command cmd
source code
 
find(self, pattern, path, directoriesToo=True)
Find all files whose names match
source code
 
listDirectory(self, d)
Lists the files in a directory, but excludes certain names and files with certain endings
source code
 
remove(self, f)
Remove a file if it exists.
source code
 
rmtree(self, path, ignore_errors=False)
Encapsulates the shutil rmtree and provides an alternative for old Python-version
source code
 
which(self, progname)
Get the full path.
source code
 
writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary
source code
Class Variables [hide private]
    Inherited from FileBasis.FileBasisBackup
  counter = {}
    Inherited from FileBasis.FileBasis
  addedString = '//PyFoamAdded'
  removedString = '//PyFoamRemoved: '
    Inherited from Basics.Utilities.Utilities
  excludeNames = ['^.svn$', '~$']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, treatBinaryAsASCII=False, backup=False, debug=False)
(Constructor)

source code 

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

Parameters:
  • name - The name of the parameter file
  • backup - create a backup-copy of the file
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

Generates a string from the contents in memory Used to be called makeString

Overrides: object.__str__
(inherited documentation)

parse(self, content)

source code 

Constructs a representation of the file

Overrides: FileBasis.FileBasis.parse