Changeset 216 for pkpgcounter/trunk/pdlanalyzer/analyzer.py
- Timestamp:
- 06/30/05 14:31:35 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pdlanalyzer/analyzer.py
r211 r216 23 23 import tempfile 24 24 25 from pdlanalyzer import version, pdlparser, postscript, pdf, pcl345, pclxl, escp2 25 from pdlanalyzer import version, pdlparser, postscript, pdf, pcl345, pclxl, escp2, dvi 26 26 27 27 KILOBYTE = 1024 … … 57 57 psyco.bind(pcl345.PCL345Parser.getJobSize) 58 58 psyco.bind(pclxl.PCLXLParser.getJobSize) 59 psyco.bind(dvi.DVIParser.getJobSize) 59 60 60 61 def getJobSize(self) : … … 172 173 if self.debug : 173 174 sys.stderr.write("%s is an ESC/P2 file\n" % str(self.filename)) 175 return 1 176 else : 177 return 0 178 179 def isDVI(self, sdata, edata) : 180 """Returns 1 if data is DVI, else 0.""" 181 if (ord(sdata[0]) == 0xf7) and (ord(edata[-1]) == 0xdf) : 182 if self.debug : 183 sys.stderr.write("%s is an DVI file\n" % str(self.filename)) 174 184 return 1 175 185 else : … … 200 210 elif self.isESCP2(firstblock, lastblock) : 201 211 return escp2.ESCP2Parser 212 elif self.isDVI(firstblock, lastblock) : 213 return dvi.DVIParser 202 214 else : 203 215 raise pdlparser.PDLParserError, "Analysis of first data block failed."