Show
Ignore:
Timestamp:
03/01/04 12:23:25 (20 years ago)
Author:
jalet
Message:

Pre and Post hooks to external commands are available in the cupspykota
backend. Forthe pykota filter they will be implemented real soon now.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1365 r1372  
    2424# 
    2525# $Log$ 
     26# Revision 1.29  2004/03/01 11:23:25  jalet 
     27# Pre and Post hooks to external commands are available in the cupspykota 
     28# backend. Forthe pykota filter they will be implemented real soon now. 
     29# 
    2630# Revision 1.28  2004/02/26 14:18:07  jalet 
    2731# Should fix the remaining bugs wrt printers groups and users groups. 
     
    201205        #            be allowed if current user is allowed to print on this printer 
    202206        if policy == "OK" : 
     207            # exports user information with initial values 
     208            self.exportUserInfo(userpquota) 
     209             
     210            # checks the user's quota 
    203211            action = self.warnUserPQuota(userpquota) 
     212             
     213            # exports some new environment variables 
     214            os.putenv("PYKOTAACTION", action) 
     215             
     216            # launches the pre hook 
     217            self.prehook(userpquota) 
     218             
    204219            self.logdebug("Job accounting begins.") 
    205220            self.accounter.beginJob(userpquota) 
     
    236251            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, jobsize, jobprice, self.preserveinputfile, self.title, self.copies, self.options) 
    237252            self.logdebug("Job added to history.") 
     253             
     254            # exports some new environment variables 
     255            os.putenv("PYKOTAJOBSIZE", str(jobsize)) 
     256            os.putenv("PYKOTAJOBPRICE", str(jobprice)) 
     257             
     258            # then re-export user information with new values 
     259            self.exportUserInfo(userpquota) 
     260             
     261            # Launches the post hook 
     262            self.posthook(userpquota) 
    238263             
    239264        return retcode