Changeset 1681

Show
Ignore:
Timestamp:
08/27/04 10:58:50 (20 years ago)
Author:
jalet
Message:

Relax checks for PCL5 header to accomodate strange printer drivers

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1680 r1681  
    2424    - 1.20alpha3 : 
    2525        
     26        - Relax checks for PCL5 header to accomodate some strange 
     27          printer drivers. 
     28           
    2629        - Now hardware accounting method works like software 
    2730          accounting method wrt the subprocess' output. 
     31           
     32        - Hardware and Software accounting stop the print queue   
     33          when the accounting subprocess didn't work. This will 
     34          be configurable in the near future. 
    2835           
    2936    - 1.20alpha2 : 
  • pykota/trunk/pykota/pdlanalyzer.py

    r1677 r1681  
    2222# 
    2323# $Log$ 
     24# Revision 1.32  2004/08/27 08:58:50  jalet 
     25# Relax checks for PCL5 header to accomodate strange printer drivers 
     26# 
    2427# Revision 1.31  2004/08/22 08:25:33  jalet 
    2528# Improved ESC/P2 miniparser thanks to Paulo Silva 
     
    637640            return 
    638641             
     642        debugfile = open("/tmp/jerome_debugs_pykota.prn", "w") 
     643         
    639644        # Use a temporary file, always seekable contrary to standard input. 
    640645        self.infile = tempfile.TemporaryFile(mode="w+b") 
     
    644649                break 
    645650            self.infile.write(data) 
     651            debugfile.write(data) 
    646652        self.infile.flush()     
    647653        self.infile.seek(0) 
     654         
     655        debugfile.flush() 
     656        debugfile.close() 
    648657             
    649658    def closeFile(self) :         
     
    688697        """Returns 1 if data is PCL, else 0.""" 
    689698        if data.startswith("\033E\033") or \ 
    690            ((data[:128].find("\033%-12345X") != -1) and \ 
    691              ((data.find("LANGUAGE=PCL") != -1) or \ 
    692               (data.find("LANGUAGE = PCL") != -1) or \ 
    693               (data.find("LANGUAGE = Pcl") != -1))) : 
     699           (data[:128].find("\033%-12345X") != -1) : 
    694700            return 1 
    695701        else :     
     
    728734        elif self.isPCLXL(firstblock) :     
    729735            return PCLXLAnalyzer 
     736        elif self.isPDF(firstblock) :     
     737            return PDFAnalyzer 
    730738        elif self.isPCL(firstblock) :     
    731739            return PCLAnalyzer 
    732         elif self.isPDF(firstblock) :     
    733             return PDFAnalyzer 
    734740        elif self.isESCP2(firstblock) :     
    735741            return ESCP2Analyzer