Changeset 2053 for pykota/trunk

Show
Ignore:
Timestamp:
02/13/05 22:26:34 (20 years ago)
Author:
jalet
Message:

Better detection of number of copies in PostScript? parser

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/pdlanalyzer.py

    r2026 r2053  
    2222# 
    2323# $Log$ 
     24# Revision 1.52  2005/02/13 21:26:34  jalet 
     25# Better detection of number of copies in PostScript parser 
     26# 
    2427# Revision 1.51  2005/01/12 14:44:27  jalet 
    2528# Fixed a fuckingly strange exception by cleverly ignoring it entirely :-) 
     
    252255            if line.startswith("%%Page: ") : 
    253256                pagecount += 1 
     257            elif line.startswith("%%Requirements: numcopies(") :     
     258                try : 
     259                    number = int(line.strip().split('(')[1].split(')')[0]) 
     260                except :      
     261                    pass 
     262                else :     
     263                    if number > self.copies : 
     264                        self.copies = number 
    254265            elif line.startswith("%%BeginNonPPDFeature: NumCopies ") : 
    255266                # handle # of copies set by some Windows printer driver