Show
Ignore:
Timestamp:
09/03/05 00:40:57 (19 years ago)
Author:
jerome
Message:

Added a PJL parsing module to extract SET and DEFAULT statements.
Improved general readability.
Fixed some minor problems thanks to pychecker.

Files:
1 modified

Legend:

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

    r243 r252  
    4747           ((self.firstblock[:128].find("\033%-12345X") != -1) and (self.firstblock.upper().find("LANGUAGE=PDF") != -1)) or \ 
    4848           (self.firstblock.find("%PDF-") != -1) : 
    49             if self.debug :   
    50                 sys.stderr.write("DEBUG: Input file is in the PDF format.\n") 
     49            self.logdebug("DEBUG: Input file is in the PDF format.") 
    5150            return 1 
    5251        else :     
     
    9998        colorregexp = re.compile(r"(/ColorSpace) ?(/DeviceRGB|/DeviceCMYK)[/ \t\r\n]", re.I) 
    10099        pagecount = 0 
    101         for object in objects.values() : 
    102             content = "".join(object.content) 
     100        for obj in objects.values() : 
     101            content = "".join(obj.content) 
    103102            count = len(newpageregexp.findall(content)) 
    104103            pagecount += count 
    105104            if colorregexp.match(content) : 
    106105                self.iscolor = 1 
    107                 if self.debug : 
    108                     sys.stderr.write("ColorSpace : %s\n" % content) 
     106                self.logdebug("ColorSpace : %s" % content) 
    109107        return pagecount     
    110108