Changeset 501 for pkpgcounter
- Timestamp:
- 11/21/07 23:05:51 (17 years ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 2 modified
- 1 moved
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 : -
pkpgcounter/trunk/pkpgpdls/pil.py
r500 r501 39 39 return False 40 40 else : 41 self.logdebug("DEBUG: Input file seems to be an image in the %s (%s) format." % (image.format, image.format_description)) 41 42 return True 42 43 -
pkpgcounter/trunk/tests/gstests.py
r499 r501 97 97 sys.stdout.write("OK\n") 98 98 passed += 1 99 print "Passed : %i %.2f" % (passed, 100.0 * passed / nbtests)100 print "Failed : %i %.2f" % (failed, 100.0 * failed / nbtests)99 print "Passed : %i (%.2f%%)" % (passed, 100.0 * passed / nbtests) 100 print "Failed : %i (%.2f%%)" % (failed, 100.0 * failed / nbtests) 101 101 102 102 def main() :