Changeset 351 for pkpgcounter/trunk/pkpgpdls/analyzer.py
- Timestamp:
- 08/14/06 00:31:48 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/analyzer.py
r350 r351 26 26 escp2, dvi, tiff, ooo, zjstream 27 27 28 class NoOption : 29 """A class for use as a default parameter to PDLAnalyzer's constructor.""" 30 debug = None 31 colorspace = None 32 resolution = None 33 28 34 class PDLAnalyzer : 29 35 """Class for PDL autodetection.""" 30 def __init__(self, filename, debug=0) :36 def __init__(self, filename, options=NoOption()) : 31 37 """Initializes the PDL analyzer. 32 38 … … 35 41 supports read() and seek(). 36 42 """ 37 self. debug = debug43 self.options = options 38 44 self.filename = filename 39 45 … … 120 126 ooo) : 121 127 try : 122 return module.Parser(self.infile, self. debug, firstblock, lastblock)128 return module.Parser(self.infile, self.options.debug, firstblock, lastblock) 123 129 except pdlparser.PDLParserError : 124 130 pass # try next parser … … 178 184 for arg in arguments : 179 185 try : 180 parser = PDLAnalyzer(arg, options .debug)186 parser = PDLAnalyzer(arg, options) 181 187 totalsize += parser.getJobSize() 182 188 except (IOError, pdlparser.PDLParserError), msg :