Changeset 3460 for pkpgcounter/trunk
- Timestamp:
- 11/25/08 00:54:51 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/analyzer.py
r3457 r3460 57 57 self.filename = filename 58 58 self.workfile = None 59 self.mustclose = None60 59 61 60 def getJobSize(self) : … … 102 101 def openFile(self) : 103 102 """Opens the job's data stream for reading.""" 104 self.mustclose = False # by default we don't want to close the file when finished105 103 if hasattr(self.filename, "read") and hasattr(self.filename, "seek") : 106 104 # filename is in fact a file-like object … … 112 110 # normal file 113 111 self.workfile = open(self.filename, "rb") 114 self.mustclose = True115 112 return 116 113 … … 131 128 def closeFile(self) : 132 129 """Closes the job's data stream if we have to.""" 133 if self.mustclose : 134 self.workfile.close() 130 self.workfile.close() 135 131 136 132 def readFirstAndLastBlocks(self, inputfile) :