Package PyFoam :: Package RunDictionary :: Module ListFile
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.RunDictionary.ListFile

 1  #  ICE Revision: $Id: /local/openfoam/Python/PyFoam/PyFoam/RunDictionary/ListFile.py 1906 2007-08-28T16:16:19.392553Z bgschaid  $  
 2  """File that contains only a list (for instance points)""" 
 3   
 4  from PyFoam.Basics.LineReader import LineReader 
 5  from SolutionFile import SolutionFile 
 6   
7 -class ListFile(SolutionFile):
8 """Represents a OpenFOAM file with only a list""" 9
10 - def __init__(self,place,name):
11 """@param place: directory of the file 12 @param name: The name of the list file""" 13 14 SolutionFile.__init__(self,place,name)
15
16 - def getSize(self):
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