Changeset 1498 for pykota/trunk/bin
- Timestamp:
- 05/25/04 10:31:16 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r1497 r1498 24 24 # 25 25 # $Log$ 26 # Revision 1.51 2004/05/25 08:31:16 jalet 27 # Heavy CPU usage seems to be fixed at least ! 28 # 26 29 # Revision 1.50 2004/05/25 05:17:50 jalet 27 30 # Now precomputes the job's size only if current printer's enforcement … … 414 417 415 418 # In any case, deal with any remaining I/O 416 availablefds = pollster.poll(5000) 419 try : 420 availablefds = pollster.poll(5000) 421 except select.error, msg : 422 self.logdebug("Interrupted poll : %s" % msg) 423 availablefds = [] 417 424 if not availablefds : 418 425 self.logdebug("Nothing to do, sleeping a bit...") … … 432 439 else : 433 440 indata = "" 441 else : 442 self.logdebug("No data to send to real backend yet, sleeping a bit...") 443 time.sleep(0.01) 444 434 445 if endinput : 435 446 self.unregisterFileNo(pollster, tocfno) … … 445 456 else : 446 457 outdata = "" 458 else : 459 # self.logdebug("No data to send back to CUPS yet, sleeping a bit...") # Uncommenting this fills your logs 460 time.sleep(0.01) # Give some time to the system, stderr is ALWAYS writeable it seems. 461 447 462 if endoutput : 448 463 self.unregisterFileNo(pollster, stderrfno) 449 464 outputclosed = 1 465 else : 466 self.logdebug("Unexpected : %s - Sleeping a bit..." % self.formatFileEvent(fd, mask)) 467 time.sleep(0.01) 468 450 469 if mask & (select.POLLIN | select.POLLPRI) : 451 470 # We have something to read … … 456 475 else : 457 476 if fd == infno : 458 indata += data459 477 if not data : # If yes, then no more input data 460 478 self.unregisterFileNo(pollster, infno) 461 479 self.logdebug("Input data ends.") 462 480 endinput = 1 # this happens with real files. 481 else : 482 indata += data 463 483 elif fd == fromcfno : 464 outdata += data 484 if not data : 485 self.logdebug("No back channel data to read from real backend yet, sleeping a bit...") 486 time.sleep(0.01) 487 else : 488 outdata += data 489 else : 490 self.logdebug("Unexpected : %s - Sleeping a bit..." % self.formatFileEvent(fd, mask)) 491 time.sleep(0.01) 492 465 493 if mask & (select.POLLHUP | select.POLLERR) : 466 494 # Treat POLLERR as an EOF. … … 477 505 os.close(fromcfno) 478 506 endoutput = 1 507 else : 508 self.logdebug("Unexpected : %s - Sleeping a bit..." % self.formatFileEvent(fd, mask)) 509 time.sleep(0.01) 479 510 480 511 if mask & select.POLLNVAL :