Changeset 415 for pkpgcounter/trunk
- Timestamp:
- 09/15/06 00:47:46 (18 years ago)
- Location:
- pkpgcounter/trunk/pkpgpdls
- Files:
-
- 13 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/dvi.py
r387 r415 75 75 return pagecount 76 76 77 def test() :78 """Test function."""79 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :80 sys.argv.append("-")81 totalsize = 082 for arg in sys.argv[1:] :83 if arg == "-" :84 infile = sys.stdin85 mustclose = 086 else :87 infile = open(arg, "rb")88 mustclose = 189 try :90 parser = Parser(infile, debug=1)91 totalsize += parser.getJobSize()92 except pdlparser.PDLParserError, msg :93 sys.stderr.write("ERROR: %s\n" % msg)94 sys.stderr.flush()95 if mustclose :96 infile.close()97 print "%s" % totalsize98 99 77 if __name__ == "__main__" : 100 test()78 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/escp2.py
r387 r415 76 76 return int(pagecount1 / 2) 77 77 78 def test() :79 """Test function."""80 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :81 sys.argv.append("-")82 totalsize = 083 for arg in sys.argv[1:] :84 if arg == "-" :85 infile = sys.stdin86 mustclose = 087 else :88 infile = open(arg, "rb")89 mustclose = 190 try :91 parser = Parser(infile, debug=1)92 totalsize += parser.getJobSize()93 except pdlparser.PDLParserError, msg :94 sys.stderr.write("ERROR: %s\n" % msg)95 sys.stderr.flush()96 if mustclose :97 infile.close()98 print "%s" % totalsize99 100 78 if __name__ == "__main__" : 101 test()79 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/oldpcl345.py
r402 r415 486 486 return pagecount 487 487 488 def test() :489 """Test function."""490 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :491 sys.argv.append("-")492 totalsize = 0493 for arg in sys.argv[1:] :494 if arg == "-" :495 infile = sys.stdin496 mustclose = 0497 else :498 infile = open(arg, "rb")499 mustclose = 1500 try :501 parser = Parser(infile, debug=1)502 totalsize += parser.getJobSize()503 except pdlparser.PDLParserError, msg :504 sys.stderr.write("ERROR: %s\n" % msg)505 sys.stderr.flush()506 if mustclose :507 infile.close()508 print "%s" % totalsize509 510 488 if __name__ == "__main__" : 511 test()489 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/ooo.py
r387 r415 64 64 return pagecount 65 65 66 def test() :67 """Test function."""68 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :69 sys.argv.append("-")70 totalsize = 071 for arg in sys.argv[1:] :72 if arg == "-" :73 infile = sys.stdin74 mustclose = 075 else :76 infile = open(arg, "rb")77 mustclose = 178 try :79 parser = Parser(infile, debug=1)80 totalsize += parser.getJobSize()81 except pdlparser.PDLParserError, msg :82 sys.stderr.write("ERROR: %s\n" % msg)83 sys.stderr.flush()84 if mustclose :85 infile.close()86 print "%s" % totalsize87 88 66 if __name__ == "__main__" : 89 test()67 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/pcl345.py
r406 r415 539 539 return self.pagecount 540 540 541 def test() :542 """Test function."""543 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :544 sys.argv.append("-")545 totalsize = 0546 for arg in sys.argv[1:] :547 if arg == "-" :548 infile = sys.stdin549 mustclose = 0550 else :551 infile = open(arg, "rb")552 mustclose = 1553 try :554 parser = Parser(infile, debug=1)555 totalsize += parser.getJobSize()556 except pdlparser.PDLParserError, msg :557 sys.stderr.write("ERROR: %s\n" % msg)558 sys.stderr.flush()559 if mustclose :560 infile.close()561 print "%s" % totalsize562 563 541 if __name__ == "__main__" : 564 test()542 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/pclxl.py
r387 r415 657 657 return self.pagecount 658 658 659 def test() :660 """Test function."""661 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :662 sys.argv.append("-")663 totalsize = 0664 for arg in sys.argv[1:] :665 if arg == "-" :666 infile = sys.stdin667 mustclose = 0668 else :669 infile = open(arg, "rb")670 mustclose = 1671 try :672 parser = Parser(infile, debug=1)673 totalsize += parser.getJobSize()674 except pdlparser.PDLParserError, msg :675 sys.stderr.write("ERROR: %s\n" % msg)676 sys.stderr.flush()677 if mustclose :678 infile.close()679 print "%s" % totalsize680 681 659 if __name__ == "__main__" : 682 test()660 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/pdf.py
r387 r415 105 105 return pagecount 106 106 107 def test() :108 """Test function."""109 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :110 sys.argv.append("-")111 totalsize = 0112 for arg in sys.argv[1:] :113 if arg == "-" :114 infile = sys.stdin115 mustclose = 0116 else :117 infile = open(arg, "rb")118 mustclose = 1119 try :120 parser = Parser(infile, debug=1)121 totalsize += parser.getJobSize()122 except pdlparser.PDLParserError, msg :123 sys.stderr.write("ERROR: %s\n" % msg)124 sys.stderr.flush()125 if mustclose :126 infile.close()127 print "%s" % totalsize128 129 107 if __name__ == "__main__" : 130 test()108 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/pdlparser.py
r387 r415 110 110 else : 111 111 raise PDLParserError, "Impossible to compute ink coverage for this file format." 112 113 def test(parserclass) : 114 """Test function.""" 115 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) : 116 sys.argv.append("-") 117 totalsize = 0 118 for arg in sys.argv[1:] : 119 if arg == "-" : 120 infile = sys.stdin 121 mustclose = 0 122 else : 123 infile = open(arg, "rb") 124 mustclose = 1 125 try : 126 parser = parserclass(infile, debug=1) 127 totalsize += parser.getJobSize() 128 except PDLParserError, msg : 129 sys.stderr.write("ERROR: %s\n" % msg) 130 sys.stderr.flush() 131 if mustclose : 132 infile.close() 133 print "%s" % totalsize 134 -
pkpgcounter/trunk/pkpgpdls/postscript.py
r389 r415 191 191 return max(nbpages, newnbpages) 192 192 193 def test() :194 """Test function."""195 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :196 sys.argv.append("-")197 totalsize = 0198 for arg in sys.argv[1:] :199 if arg == "-" :200 infile = sys.stdin201 mustclose = 0202 else :203 infile = open(arg, "rb")204 mustclose = 1205 try :206 parser = Parser(infile, debug=1)207 totalsize += parser.getJobSize()208 except pdlparser.PDLParserError, msg :209 sys.stderr.write("ERROR: %s\n" % msg)210 sys.stderr.flush()211 if mustclose :212 infile.close()213 print "%s" % totalsize214 215 193 if __name__ == "__main__" : 216 test()194 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/qpdl.py
r387 r415 294 294 return self.pagecount 295 295 296 def test() :297 """Test function."""298 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :299 sys.argv.append("-")300 totalsize = 0301 for arg in sys.argv[1:] :302 if arg == "-" :303 infile = sys.stdin304 mustclose = 0305 else :306 infile = open(arg, "rb")307 mustclose = 1308 try :309 parser = Parser(infile, debug=1)310 totalsize += parser.getJobSize()311 except pdlparser.PDLParserError, msg :312 sys.stderr.write("ERROR: %s\n" % msg)313 sys.stderr.flush()314 if mustclose :315 infile.close()316 print "%s" % totalsize317 318 296 if __name__ == "__main__" : 319 test()297 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/spl1.py
r410 r415 128 128 return self.pagecount 129 129 130 def test() :131 """Test function."""132 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :133 sys.argv.append("-")134 totalsize = 0135 for arg in sys.argv[1:] :136 if arg == "-" :137 infile = sys.stdin138 mustclose = 0139 else :140 infile = open(arg, "rb")141 mustclose = 1142 try :143 parser = Parser(infile, debug=1)144 totalsize += parser.getJobSize()145 except pdlparser.PDLParserError, msg :146 sys.stderr.write("ERROR: %s\n" % msg)147 sys.stderr.flush()148 if mustclose :149 infile.close()150 print "%s" % totalsize151 152 130 if __name__ == "__main__" : 153 test()131 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/tiff.py
r387 r415 79 79 return pagecount 80 80 81 def test() :82 """Test function."""83 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :84 sys.argv.append("-")85 totalsize = 086 for arg in sys.argv[1:] :87 if arg == "-" :88 infile = sys.stdin89 mustclose = 090 else :91 infile = open(arg, "rb")92 mustclose = 193 try :94 parser = Parser(infile, debug=1)95 totalsize += parser.getJobSize()96 except pdlparser.PDLParserError, msg :97 sys.stderr.write("ERROR: %s\n" % msg)98 sys.stderr.flush()99 if mustclose :100 infile.close()101 print "%s" % totalsize102 103 81 if __name__ == "__main__" : 104 test()82 pdlparser.test(Parser) -
pkpgcounter/trunk/pkpgpdls/zjstream.py
r387 r415 104 104 return max(startpagecount, endpagecount) 105 105 106 def test() :107 """Test function."""108 if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) :109 sys.argv.append("-")110 totalsize = 0111 for arg in sys.argv[1:] :112 if arg == "-" :113 infile = sys.stdin114 mustclose = 0115 else :116 infile = open(arg, "rb")117 mustclose = 1118 try :119 parser = Parser(infile, debug=1)120 totalsize += parser.getJobSize()121 except pdlparser.PDLParserError, msg :122 sys.stderr.write("ERROR: %s\n" % msg)123 sys.stderr.flush()124 if mustclose :125 infile.close()126 print "%s" % totalsize127 128 106 if __name__ == "__main__" : 129 test()107 pdlparser.test(Parser)