- Timestamp:
- 05/04/04 06:39:26 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkpgcounter
r1447 r1448 24 24 # 25 25 # $Log$ 26 # Revision 1.3 2004/05/04 04:39:26 jalet 27 # Better PCL support 28 # 26 29 # Revision 1.2 2004/05/04 03:14:26 jalet 27 30 # fixed copy&paste problem in pkpgcounter … … 80 83 # Backported from C to Python by Jerome Alet 81 84 # 82 tagsends = { " *b" : "W", "(s" : "W", ")s" : "W", "&p" : "X", "&l" : "X" }85 tagsends = { "&n" : "W", "&b": "W", "*i" : "W", "*l" : "W", "*m" : "W", "*v": "W", "*c" : "W", "(f" : "W", "*b" : "VW", "(s" : "W", ")s" : "W", "&p" : "X", "&l" : "X" } 83 86 copies = 1 84 87 pagecount = 0 … … 92 95 elif char == "\033" : 93 96 # 94 # <ESC>*b###W -> Start of a binary block 97 # <ESC>*b###W -> Start of a raster data row/block 98 # <ESC>*b###V -> Start of a raster data plane 99 # <ESC>*c###W -> Start of a user defined pattern 100 # <ESC>*i###W -> Start of a viewing illuminant block 101 # <ESC>*l###W -> Start of a color lookup table 102 # <ESC>*m###W -> Start of a download dither matrix block 103 # <ESC>*v###W -> Start of a configure image data block 95 104 # <ESC>(s###W -> Start of a characters description block 96 105 # <ESC>)s###W -> Start of a fonts description block 106 # <ESC>(f###W -> Start of a symbol set block 107 # <ESC>&b###W -> Start of configuration data block 108 # <ESC>&l###X -> Number of copies 109 # <ESC>&n###W -> Starts an alphanumeric string ID block 97 110 # <ESC>&p###X -> Start of a non printable characters block 98 # <ESC>&l###X -> Number of copies99 111 # 100 tag = infile.read(2) 112 tagstart = infile.read(1) 113 if tagstart in "E9=YZ" : # one byte PCL tag 114 continue # skip to next tag 115 tag = tagstart + infile.read(1) 101 116 try : 102 117 tagend = tagsends[tag] … … 111 126 break 112 127 size = (size * 10) + int(char) 113 if char ==tagend :128 if char in tagend : 114 129 if tag == "&l" : 115 130 copies = size … … 118 133 # for unseekable streams. 119 134 # we just ignore the block anyway. 135 if tag == "&n" : 136 # we have to take care of the operation id byte 137 # which is before the string itself 138 size += 1 120 139 infile.read(size) 121 140 return copies * pagecount -
pykota/trunk/NEWS
r1447 r1448 26 26 - a bad copy&paste prevented pkpgcounter to work at all, this 27 27 is now fixed. 28 29 - improved PCL support in pkpgcounter. 28 30 29 31 - 1.19alpha3 :