334 | | raise RuntimeError, "Not implemented !" |
| 334 | if (len(sys.argv) < 2) or ((not sys.stdin.isatty()) and ("-" not in sys.argv[1:])) : |
| 335 | sys.argv.append("-") |
| 336 | totalsize = 0 |
| 337 | for arg in sys.argv[1:] : |
| 338 | if arg == "-" : |
| 339 | infile = sys.stdin |
| 340 | mustclose = 0 |
| 341 | else : |
| 342 | infile = open(arg, "rb") |
| 343 | mustclose = 1 |
| 344 | try : |
| 345 | parser = PCL345Parser(infile, debug=1) |
| 346 | totalsize += parser.getJobSize() |
| 347 | except PDLParserError, msg : |
| 348 | sys.stderr.write("ERROR: %s\n" % msg) |
| 349 | sys.stderr.flush() |
| 350 | if mustclose : |
| 351 | infile.close() |
| 352 | print "%s" % totalsize |