PyFoam.Basics.LineReader module

Read a file line by line

class PyFoam.Basics.LineReader.LineReader(stripAllSpaces=True)[source]

Bases: object

Read a line from a file

The line is stripped of whitespaces at the start and the end of the line and stored in a variable self.line

bytesRead()[source]
Returns:number of bytes that were already read
read(fh)[source]

reads the next line

fh - filehandle to read from

Return value: False if the end of the file was reached. True otherwise

reset()[source]

Reset the reader

userSaidStop()[source]
Returns:whether the reader caught a Keyboard-interrupt