PyFoam.Basics.BasicFile module

Basic file output

class PyFoam.Basics.BasicFile.BasicFile(name)[source]

Bases: object

File for data output

The format of the file is: one data-set per line Values are separated by tabs

The file is created the first time it is written

__dict__ = dict_proxy({'__module__': 'PyFoam.Basics.BasicFile', 'outputAtLineStart': <function outputAtLineStart>, 'outputAtEnd': <function outputAtEnd>, 'outputAtStart': <function outputAtStart>, 'outputAtLineEnd': <function outputAtLineEnd>, 'writeLine': <function writeLine>, 'close': <function close>, '__dict__': <attribute '__dict__' of 'BasicFile' objects>, 'callAtOpen': <function callAtOpen>, 'callAtClose': <function callAtClose>, '__weakref__': <attribute '__weakref__' of 'BasicFile' objects>, '__doc__': 'File for data output\n\n The format of the file is: one data-set per line\n Values are separated by tabs\n\n The file is created the first time it is written', '__init__': <function __init__>, 'getHandle': <function getHandle>})
__init__(name)[source]

name - name of the file

__module__ = 'PyFoam.Basics.BasicFile'
__weakref__

list of weak references to the object (if defined)

callAtClose()[source]

A hook that gets called when the file is closed

callAtOpen()[source]

A hook that gets called when the file is opened

close(temporary=False)[source]

close the file :param temporary: only close the file temporary (to be appended on later)

getHandle()[source]

get the file-handle. File is created and opened if it wasn’t opened before

outputAtEnd()[source]

A hook for outputting stuff at the end of the file

outputAtLineEnd()[source]

A hook for outputting stuff at the end of each line

outputAtLineStart()[source]

A hook for outputting stuff at the start of each line

outputAtStart()[source]

A hook for outputting stuff at the beginning of the file

writeLine(data)[source]

write a data set

data - a tuple with the data-set