Changeset 520 for pkpgcounter/trunk/pkpgpdls/pdlparser.py
- Timestamp:
- 11/28/07 00:52:52 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/pdlparser.py
r493 r520 43 43 totiffcommands = None # Default command to convert to TIFF 44 44 openmode = "rb" # Default file opening mode 45 def __init__(self, filename, firstblock, lastblock, debug=0) :45 def __init__(self, parent) : 46 46 """Initialize the generic parser.""" 47 self.filename = filename 48 self.debug = debug 47 self.parent = parent 49 48 self.infile = None 50 (self.firstblock, self.lastblock) = (firstblock, lastblock)51 49 if not self.isValid() : 52 50 raise PDLParserError, "Invalid file format !" … … 60 58 # parsing will greatly benefit from this. 61 59 psyco.bind(self.getJobSize) 62 self.infile = open(self. filename, self.openmode)63 # self.logdebug("Opened %s in '%s' mode." % (self. filename, self.openmode))60 self.infile = open(self.parent.filename, self.openmode) 61 # self.logdebug("Opened %s in '%s' mode." % (self.parent.filename, self.openmode)) 64 62 65 63 def __del__(self) : … … 70 68 def logdebug(self, message) : 71 69 """Logs a debug message if needed.""" 72 if self. debug :70 if self.parent.options.debug : 73 71 sys.stderr.write("%s\n" % message) 74 72 … … 86 84 """ 87 85 if self.totiffcommands : 88 infname = self. filename86 infname = self.parent.filename 89 87 for totiffcommand in self.totiffcommands : 90 88 error = False