PyFoam.Execution.BasicWatcher module

Watches the output of Foam-run

class PyFoam.Execution.BasicWatcher.BasicWatcher(filenames, silent=False, tailLength=1000, sleep=0.1, endTime=None, follow=True)[source]

Bases: object

Base class for watching the output of commands

Works like the UNIX-command ‘tail -f <file>’: the last lines of the file are output. If the file grows then these lines are output as they arrive

addChangeFileHook(func)[source]
changeFile(filename)[source]
getSize(filename)[source]
Returns:the current size (in bytes) of the file
lineHandle(line)[source]

called every time a new line is read

start()[source]

Reads the file and does the processing

startHandle()[source]

to be called before the program is started

stopHandle()[source]

called after the program has stopped

tailingHandle()[source]

called when the first line is output