Changeset 501 for pkpgcounter/trunk/pkpgpdls/analyzer.py
- Timestamp:
- 11/21/07 23:05:51 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/analyzer.py
r493 r501 28 28 import tempfile 29 29 30 import version, pdlparser, postscript, pdf, pcl345, pclxl, hbp, \30 import version, pdlparser, postscript, pdf, pcl345, pclxl, hbp, pil, \ 31 31 lidil, escp2, dvi, tiff, ooo, zjstream, qpdl, spl1, escpages03, plain 32 32 import inkcoverage … … 82 82 try : 83 83 pdlhandler = self.detectPDLHandler() 84 (handle, filename) = tempfile.mkstemp(".tmp", "pkpgcounter")85 os.close(handle)84 dummyfile = tempfile.NamedTemporaryFile(mode="w+b") 85 filename = dummyfile.name 86 86 try : 87 87 pdlhandler.convertToTiffMultiPage24NC(filename, self.options.resolution) 88 88 result = inkcoverage.getInkCoverage(filename, cspace) 89 89 finally : 90 try : 91 os.remove(filename) 92 except OSError : 93 sys.stderr.write("Problem while trying to remove temporary file %s\n" % filename) 90 dummyfile.close() 94 91 except pdlparser.PDLParserError, msg : 95 92 raise pdlparser.PDLParserError, "Unknown file format for %s (%s)" % (self.filename, msg) … … 161 158 escp2, \ 162 159 escpages03, \ 160 pil, \ 163 161 plain) : # IMPORTANT : don't move this one up ! 164 162 try :