1
2 """File that contains only a list (for instance points)"""
3
4 from PyFoam.Basics.LineReader import LineReader
5 from SolutionFile import SolutionFile
6
8 """Represents a OpenFOAM file with only a list"""
9
11 """@param place: directory of the file
12 @param name: The name of the list file"""
13
14 SolutionFile.__init__(self,place,name)
15
17 """@return: the size of the list"""
18
19 size=-1L
20
21 l=LineReader()
22 self.openFile()
23
24 erg=""
25
26 while l.read(self.fh):
27 try:
28 size=long(l.line)
29 break
30 except ValueError:
31 pass
32
33 self.closeFile()
34
35 return size
36