Show
Ignore:
Timestamp:
11/28/07 18:28:30 (16 years ago)
Author:
jerome
Message:

Now the presence of executable dependencies is tested at runtime.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/postscript.py

    r522 r527  
    2525import sys 
    2626import os 
    27 import tempfile 
    28 import popen2 
    2927 
    3028import pdlparser 
     
    3432    """A parser for PostScript documents.""" 
    3533    totiffcommands = [ 'gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" "%(infname)s"' ] 
     34    required = [ "gs" ] 
    3635    openmode = "rU" 
    3736    def isValid(self) :     
     
    5352        """Get the count through GhostScript, useful for non-DSC compliant PS files.""" 
    5453        self.logdebug("Internal parser sucks, using GhostScript instead...") 
     54        if self.isMissing(self.required) : 
     55            raise pdlparser.PDLParserError, "The gs interpreter is nowhere to be found in your PATH (%s)" % os.environ.get("PATH", "") 
    5556        infname = self.filename 
    5657        command = 'gs -sDEVICE=bbox -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET "%(infname)s" 2>&1 | grep -c "%%HiResBoundingBox:" 2>/dev/null'