Changeset 1516
- Timestamp:
- 06/03/04 10:51:03 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/waitprinter.sh
r1405 r1516 24 24 # the printer would effectively never print again if the previous job 25 25 # was already fully printed. 26 if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE == "xAFTER" ] ; then26 if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE == "xAFTER" ] && [ x$PYKOTAJOBSIZEBYTES != "x0" ] ; then 27 27 until snmpget -v1 -c public -Ov $1 HOST-RESOURCES-MIB::hrPrinterStatus.1 | grep -i printing >/dev/null; do 28 28 sleep 1 ; -
pykota/trunk/pykota/tool.py
r1514 r1516 22 22 # 23 23 # $Log$ 24 # Revision 1.94 2004/06/03 08:51:03 jalet 25 # logs job's size in bytes now 26 # 24 27 # Revision 1.93 2004/06/02 21:51:02 jalet 25 28 # Moved the sigterm capturing elsewhere … … 813 816 self.exportJobInfo() 814 817 self.jobdatastream = self.openJobDataStream() 818 os.putenv("PYKOTAJOBSIZEBYTES", str(self.JobSizeBytes)) 819 self.logdebug("Job size is %s bytes" % self.JobSizeBytes) 815 820 self.logdebug("Capturing SIGTERM events.") 816 821 signal.signal(signal.SIGTERM, self.sigterm_handler) … … 824 829 self.logdebug("Duplicating data stream from stdin to temporary file") 825 830 MEGABYTE = 1024*1024 831 self.JobSizeBytes = 0 826 832 infile = tempfile.TemporaryFile() 827 833 while 1 : … … 829 835 if not data : 830 836 break 837 self.JobSizeBytes += len(data) 831 838 infile.write(data) 832 839 infile.flush() … … 836 843 # real file, just open it 837 844 self.logdebug("Opening data stream %s" % self.preserveinputfile) 845 self.JobSizeBytes = os.stat(self.preserveinputfile)[6] 838 846 return open(self.preserveinputfile, "rb") 839 847