Changeset 1516

Show
Ignore:
Timestamp:
06/03/04 10:51:03 (20 years ago)
Author:
jalet
Message:

logs job's size in bytes now

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/waitprinter.sh

    r1405 r1516  
    2424# the printer would effectively never print again if the previous job 
    2525# was already fully printed. 
    26 if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE == "xAFTER" ]; then 
     26if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE == "xAFTER" ] && [ x$PYKOTAJOBSIZEBYTES != "x0" ] ; then 
    2727  until snmpget -v1 -c public -Ov $1 HOST-RESOURCES-MIB::hrPrinterStatus.1 | grep -i printing >/dev/null; do 
    2828   sleep 1 ; 
  • pykota/trunk/pykota/tool.py

    r1514 r1516  
    2222# 
    2323# $Log$ 
     24# Revision 1.94  2004/06/03 08:51:03  jalet 
     25# logs job's size in bytes now 
     26# 
    2427# Revision 1.93  2004/06/02 21:51:02  jalet 
    2528# Moved the sigterm capturing elsewhere 
     
    813816        self.exportJobInfo() 
    814817        self.jobdatastream = self.openJobDataStream() 
     818        os.putenv("PYKOTAJOBSIZEBYTES", str(self.JobSizeBytes)) 
     819        self.logdebug("Job size is %s bytes" % self.JobSizeBytes) 
    815820        self.logdebug("Capturing SIGTERM events.") 
    816821        signal.signal(signal.SIGTERM, self.sigterm_handler) 
     
    824829            self.logdebug("Duplicating data stream from stdin to temporary file") 
    825830            MEGABYTE = 1024*1024 
     831            self.JobSizeBytes = 0 
    826832            infile = tempfile.TemporaryFile() 
    827833            while 1 : 
     
    829835                if not data : 
    830836                    break 
     837                self.JobSizeBytes += len(data)     
    831838                infile.write(data) 
    832839            infile.flush()     
     
    836843            # real file, just open it 
    837844            self.logdebug("Opening data stream %s" % self.preserveinputfile) 
     845            self.JobSizeBytes = os.stat(self.preserveinputfile)[6] 
    838846            return open(self.preserveinputfile, "rb") 
    839847