Changeset 220 for pkpgcounter/trunk/pdlanalyzer/dvi.py
- Timestamp:
- 07/02/05 15:41:30 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pdlanalyzer/dvi.py
r218 r220 29 29 from pdlanalyzer import pdlparser 30 30 31 class DVIParser(pdlparser.PDLParser) :31 class Parser(pdlparser.PDLParser) : 32 32 """A parser for DVI documents.""" 33 def isValid(self) : 34 """Returns 1 if data is DVI, else 0.""" 35 try : 36 if (ord(self.firstblock[0]) == 0xf7) and (ord(self.lastblock[-1]) == 0xdf) : 37 if self.debug : 38 sys.stderr.write("DEBUG: Input file is in the DVI format.\n") 39 return 1 40 else : 41 return 0 42 except IndexError : 43 return 0 44 33 45 def getJobSize(self) : 34 46 """Counts pages in a DVI document. … … 74 86 mustclose = 1 75 87 try : 76 parser = DVIParser(infile, debug=1)88 parser = Parser(infile, debug=1) 77 89 totalsize += parser.getJobSize() 78 90 except pdlparser.PDLParserError, msg :