Show
Ignore:
Timestamp:
11/28/07 00:52:52 (17 years ago)
Author:
jerome
Message:

Code cleaning.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/pdlparser.py

    r493 r520  
    4343    totiffcommands = None        # Default command to convert to TIFF 
    4444    openmode = "rb"              # Default file opening mode 
    45     def __init__(self, filename, firstblock, lastblock, debug=0) : 
     45    def __init__(self, parent) : 
    4646        """Initialize the generic parser.""" 
    47         self.filename = filename 
    48         self.debug = debug 
     47        self.parent = parent 
    4948        self.infile = None 
    50         (self.firstblock, self.lastblock) = (firstblock, lastblock) 
    5149        if not self.isValid() : 
    5250            raise PDLParserError, "Invalid file format !" 
     
    6058            # parsing will greatly benefit from this. 
    6159            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)) 
    6462             
    6563    def __del__(self) : 
     
    7068    def logdebug(self, message) :        
    7169        """Logs a debug message if needed.""" 
    72         if self.debug : 
     70        if self.parent.options.debug : 
    7371            sys.stderr.write("%s\n" % message) 
    7472             
     
    8684        """    
    8785        if self.totiffcommands : 
    88             infname = self.filename 
     86            infname = self.parent.filename 
    8987            for totiffcommand in self.totiffcommands : 
    9088                error = False