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

Source Code for Module PyFoam.RunDictionary.ListFile

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