Changeset 1371 for pykota

Show
Ignore:
Timestamp:
03/01/04 11:22:30 (21 years ago)
Author:
jalet
Message:

Can now extract per printer pre and post hooks from the configuration file

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/config.py

    r1356 r1371  
    2222# 
    2323# $Log$ 
     24# Revision 1.45  2004/03/01 10:22:30  jalet 
     25# Can now extract per printer pre and post hooks from the configuration file 
     26# 
    2427# Revision 1.44  2004/02/20 14:42:21  jalet 
    2528# Experimental ldapcache directive added 
     
    304307        """    
    305308        validaccounters = [ "querying", "stupid", "external" ]      
    306         try : 
    307             fullaccounter = self.getPrinterOption(printername, "accounter").strip() 
    308         except PyKotaConfigError :     
    309             fullaccounter = "querying" 
     309        fullaccounter = self.getPrinterOption(printername, "accounter").strip() 
    310310        if fullaccounter.lower().startswith("external") :     
    311311            try : 
     
    323323            return (fullaccounter.lower(), None) 
    324324         
     325    def getPreHook(self, printername) :     
     326        """Returns the prehook command line to launch, or None if unset.""" 
     327        try : 
     328            return self.getPrinterOption(printername, "prehook").strip() 
     329        except PyKotaConfigError :     
     330            return      # No command to launch in the pre-hook 
     331             
     332    def getPostHook(self, printername) :     
     333        """Returns the posthook command line to launch, or None if unset.""" 
     334        try : 
     335            return self.getPrinterOption(printername, "posthook").strip() 
     336        except PyKotaConfigError :     
     337            return      # No command to launch in the post-hook 
     338             
    325339    def getRequesterBackend(self, printername) :     
    326340        """Returns the requester backend to use for a given printer, with its arguments."""