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/pil.py

    r522 r527  
    2323"""This modules implements a page counter for image formats supported by the Python Imaging Library.""" 
    2424 
    25 from PIL import Image 
     25import pdlparser 
    2626 
    27 import pdlparser 
     27try : 
     28    from PIL import Image 
     29except ImportError :     
     30    sys.stderr.write("ERROR: You MUST install the Python Imaging Library (python-imaging) for pkpgcounter to work.\n") 
     31    raise pdlparser.PDLParserError, "The Python Imaging Library is missing." 
     32 
    2833import version 
    2934 
    3035class Parser(pdlparser.PDLParser) : 
    3136    """A parser for plain text documents.""" 
    32     totiffcommands = [ 'convert "%(infname)s" "%(outfname)s"', 
    33                      ]   
     37    totiffcommands = [ 'convert "%(infname)s" "%(outfname)s"' ]   
     38    required = [ "convert" ] 
    3439    def isValid(self) :     
    3540        """Returns True if data is an image format supported by PIL, else False."""