Index: /pykota/trunk/conf/pykota.conf.sample
===================================================================
--- /pykota/trunk/conf/pykota.conf.sample (revision 1875)
+++ /pykota/trunk/conf/pykota.conf.sample (revision 1914)
@@ -600,4 +600,56 @@
 # posthook: /usr/bin/printenv >/tmp/after
 
+# AccountBanner : how should banner accounting be done ?
+# 
+# If enabled, banner pages printed from StartingBanner and/or EndingBanner 
+# (depending on the value) will be included in the accounting for the
+# print job
+#
+# If disabled, banner pages printed from StartingBanner and EndingBanner will
+# *not* be included in the accounting for the print job
+#
+# IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you
+#             can refund them by using negative prices on printers.
+#
+# Allowed values : Starting | Ending | None | Both
+#
+#       - Starting : only the starting banner will be accounted for.
+#       - Ending : only the ending banner will be accounted for.
+#       - Both : both starting and ending banners will be accounted for.
+#       - None : banners will not be accounted for.
+#
+# Default value :
+# accountbanner: Both
+
+# StartingBanner : if defined will print a banner before the rest of the job 
+# is printed. The argument can be a printable file, or an executable file.
+# If not executable, the file will be printed as is. If executable, the 
+# file will be executed and its output will be printed.
+# 
+# In any case, the banner content which will be sent to the printer
+# MUST be in a format your printer will accept !!!
+#
+# The pkbanner command included in PyKota can automatically generate
+# starting and ending banners in the PostScript format. You can use
+# this command in a pipe through GhostScript if your printer doesn't 
+# accept PostScript as an input format.
+#
+# startingbanner: /usr/share/pykota/banner-page.sh
+
+# EndingBanner : if defined will print a banner before the rest of the job 
+# is printed. The argument can be a printable file, or an executable file.
+# If not executable, the file will be printed as is. If executable, the 
+# file will be executed and its output will be printed.
+#
+# In any case, the banner content which will be sent to the printer
+# MUST be in a format your printer will accept !!!
+#
+# The pkbanner command included in PyKota can automatically generate
+# starting and ending banners in the PostScript format. You can use
+# this command in a pipe through GhostScript if your printer doesn't 
+# accept PostScript as an input format.
+#
+# endingbanner: /usr/share/pykota/banner-page.sh
+
 # How should enforcement be done for this printer ?
 #
Index: /pykota/trunk/pykota/config.py
===================================================================
--- /pykota/trunk/pykota/config.py (revision 1875)
+++ /pykota/trunk/pykota/config.py (revision 1914)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.55  2004/11/15 15:14:06  jalet
+# Preliminary integration of Matt's patch for banners.
+#
 # Revision 1.54  2004/10/25 14:12:25  jalet
 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf
@@ -490,5 +493,5 @@
             gd = self.getPrinterOption(printername, "gracedelay")
         except PyKotaConfigError :    
-            gd = 7
+            gd = 7      # default value of 7 days
         try :
             return int(gd)
@@ -501,5 +504,5 @@
             pm = self.getGlobalOption("poorman")
         except PyKotaConfigError :    
-            pm = 1.0
+            pm = 1.0    # default value of 1 unit
         try :
             return float(pm)
@@ -555,2 +558,29 @@
         """Returns the winbind separator's value if it is set, else None."""
         return self.getGlobalOption("winbind_separator", ignore=1)
+
+    def getAccountBanner(self, printername) :
+        """Returns which banner(s) to account for: NONE, BOTH, STARTING, ENDING."""
+        validvalues = [ "NONE", "BOTH", "STARTING", "ENDING" ]     
+        try :
+            value = self.getPrinterOption(printername, "accountbanner")
+        except PyKotaConfigError :    
+            return "BOTH"       # Default value of BOTH
+        else :    
+            value = value.upper()
+            if value not in validvalues :
+                raise PyKotaConfigError, _("Option onaccountererror in section %s only supports values in %s") % (printername, str(validvalues))
+            return value  
+
+    def getStartingBanner(self, printername) :
+        """Returns the startingbanner value if set, else None."""
+        try :
+            return self.getPrinterOption(printername, "startingbanner")
+        except PyKotaConfigError :
+            return None
+
+    def getEndingBanner(self, printername) :
+        """Returns the endingbanner value if set, else None."""
+        try :
+            return self.getPrinterOption(printername, "endingbanner")
+        except PyKotaConfigError :
+            return None
