root / pykota / trunk / pykota / config.py @ 1968

Revision 1968, 25.2 kB (checked in by jalet, 19 years ago)

TLS is now supported with the LDAP backend

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# PyKota
2# -*- coding: ISO-8859-15 -*-
3#
4# PyKota : Print Quotas for CUPS and LPRng
5#
6# (c) 2003-2004 Jerome Alet <alet@librelogiciel.com>
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20#
21# $Id$
22#
23# $Log$
24# Revision 1.58  2004/12/02 22:01:58  jalet
25# TLS is now supported with the LDAP backend
26#
27# Revision 1.57  2004/11/22 21:53:38  jalet
28# Added the reject_unknown directive to pykota.conf to reject user/group
29# creation if user or group is unknown to the system
30#
31# Revision 1.56  2004/11/15 15:23:07  jalet
32# Strips spaces just in case
33#
34# Revision 1.55  2004/11/15 15:14:06  jalet
35# Preliminary integration of Matt's patch for banners.
36#
37# Revision 1.54  2004/10/25 14:12:25  jalet
38# For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf
39# to hide print jobs' title, filename, and options.
40#
41# Revision 1.53  2004/10/06 10:05:47  jalet
42# Minor changes to allow any PyKota administrator to launch enhanced versions
43# of the commands, and not only the root user.
44#
45# Revision 1.52  2004/09/29 20:20:52  jalet
46# Added the winbind_separator directive to pykota.conf to allow the admin to
47# strip out the Samba/Winbind domain name when users print.
48#
49# Revision 1.51  2004/08/31 23:29:53  jalet
50# Introduction of the new 'onaccountererror' configuration directive.
51# Small fix for software accounter's return code which can't be None anymore.
52# Make software and hardware accounting code look similar : will be factorized
53# later.
54#
55# Revision 1.50  2004/07/27 07:07:27  jalet
56# Typo : treshold ==> threshold
57#
58# Revision 1.49  2004/06/03 21:53:24  jalet
59# crashrecipient directive
60#
61# Revision 1.48  2004/05/24 22:45:49  jalet
62# New 'enforcement' directive added
63# Polling loop improvements
64#
65# Revision 1.47  2004/05/18 14:49:20  jalet
66# Big code changes to completely remove the need for "requester" directives,
67# jsut use "hardware(... your previous requester directive's content ...)"
68#
69# Revision 1.46  2004/05/13 13:59:28  jalet
70# Code simplifications
71#
72# Revision 1.45  2004/03/01 10:22:30  jalet
73# Can now extract per printer pre and post hooks from the configuration file
74#
75# Revision 1.44  2004/02/20 14:42:21  jalet
76# Experimental ldapcache directive added
77#
78# Revision 1.43  2004/02/19 14:20:21  jalet
79# maildomain pykota.conf directive added.
80# Small improvements on mail headers quality.
81#
82# Revision 1.42  2004/01/08 14:10:32  jalet
83# Copyright year changed.
84#
85# Revision 1.41  2003/11/29 20:06:20  jalet
86# Added 'utolower' configuration option to convert all usernames to
87# lowercase when printing. All database accesses are still and will
88# remain case sensitive though.
89#
90# Revision 1.40  2003/11/18 23:43:12  jalet
91# Mailto can be any external command now, as usual.
92#
93# Revision 1.39  2003/10/08 21:41:38  jalet
94# External policies for printers works !
95# We can now auto-add users on first print, and do other useful things if needed.
96#
97# Revision 1.38  2003/10/07 22:06:05  jalet
98# Preliminary code to disable job history
99#
100# Revision 1.37  2003/10/07 09:07:28  jalet
101# Character encoding added to please latest version of Python
102#
103# Revision 1.36  2003/10/02 20:23:18  jalet
104# Storage caching mechanism added.
105#
106# Revision 1.35  2003/07/29 09:54:03  jalet
107# Added configurable LDAP mail attribute support
108#
109# Revision 1.34  2003/07/28 09:11:12  jalet
110# PyKota now tries to add its attributes intelligently in existing LDAP
111# directories.
112#
113# Revision 1.33  2003/07/16 21:53:07  jalet
114# Really big modifications wrt new configuration file's location and content.
115#
116# Revision 1.32  2003/07/08 19:43:51  jalet
117# Configurable warning messages.
118# Poor man's treshold value added.
119#
120# Revision 1.31  2003/07/07 11:49:24  jalet
121# Lots of small fixes with the help of PyChecker
122#
123# Revision 1.30  2003/06/25 14:10:01  jalet
124# Hey, it may work (edpykota --reset excepted) !
125#
126# Revision 1.29  2003/06/14 22:44:21  jalet
127# More work on LDAP storage backend.
128#
129# Revision 1.28  2003/06/10 16:37:54  jalet
130# Deletion of the second user which is not needed anymore.
131# Added a debug configuration field in /etc/pykota.conf
132# All queries can now be sent to the logger in debug mode, this will
133# greatly help improve performance when time for this will come.
134#
135# Revision 1.27  2003/05/27 23:00:21  jalet
136# Big rewrite of external accounting methods.
137# Should work well now.
138#
139# Revision 1.26  2003/04/30 19:53:58  jalet
140# 1.05
141#
142# Revision 1.25  2003/04/30 13:36:40  jalet
143# Stupid accounting method was added.
144#
145# Revision 1.24  2003/04/29 18:37:54  jalet
146# Pluggable accounting methods (actually doesn't support external scripts)
147#
148# Revision 1.23  2003/04/24 11:53:48  jalet
149# Default policy for unknown users/groups is to DENY printing instead
150# of the previous default to ALLOW printing. This is to solve an accuracy
151# problem. If you set the policy to ALLOW, jobs printed by in nexistant user
152# (from PyKota's POV) will be charged to the next user who prints on the
153# same printer.
154#
155# Revision 1.22  2003/04/23 22:13:57  jalet
156# Preliminary support for LPRng added BUT STILL UNTESTED.
157#
158# Revision 1.21  2003/03/29 13:45:27  jalet
159# GPL paragraphs were incorrectly (from memory) copied into the sources.
160# Two README files were added.
161# Upgrade script for PostgreSQL pre 1.01 schema was added.
162#
163# Revision 1.20  2003/03/29 13:08:28  jalet
164# Configuration is now expected to be found in /etc/pykota.conf instead of
165# in /etc/cups/pykota.conf
166# Installation script can move old config files to the new location if needed.
167# Better error handling if configuration file is absent.
168#
169# Revision 1.19  2003/03/16 09:56:52  jalet
170# Mailto option now accepts some additional values which all mean that
171# nobody will receive any email message.
172# Mailto option now works. Version 1.01 is now officially out.
173#
174# Revision 1.18  2003/03/16 08:00:50  jalet
175# Default hard coded options are now used if they are not set in the
176# configuration file.
177#
178# Revision 1.17  2003/03/15 23:01:28  jalet
179# New mailto option in configuration file added.
180# No time to test this tonight (although it should work).
181#
182# Revision 1.16  2003/02/17 23:01:56  jalet
183# Typos
184#
185# Revision 1.15  2003/02/17 22:55:01  jalet
186# More options can now be set per printer or globally :
187#
188#       admin
189#       adminmail
190#       gracedelay
191#       requester
192#
193# the printer option has priority when both are defined.
194#
195# Revision 1.14  2003/02/17 22:05:50  jalet
196# Storage backend now supports admin and user passwords (untested)
197#
198# Revision 1.13  2003/02/10 11:47:39  jalet
199# Moved some code down into the requesters
200#
201# Revision 1.12  2003/02/10 10:36:33  jalet
202# Small problem wrt external requester
203#
204# Revision 1.11  2003/02/10 08:50:45  jalet
205# External requester seems to be finally ok now
206#
207# Revision 1.10  2003/02/10 08:19:57  jalet
208# tell ConfigParser to return raw data, this allows our own strings
209# interpolations in the requester
210#
211# Revision 1.9  2003/02/10 00:44:38  jalet
212# Typos
213#
214# Revision 1.8  2003/02/10 00:42:17  jalet
215# External requester should be ok (untested)
216# New syntax for configuration file wrt requesters
217#
218# Revision 1.7  2003/02/09 13:05:43  jalet
219# Internationalization continues...
220#
221# Revision 1.6  2003/02/07 22:00:09  jalet
222# Bad cut&paste
223#
224# Revision 1.5  2003/02/06 23:58:05  jalet
225# repykota should be ok
226#
227# Revision 1.4  2003/02/06 09:19:02  jalet
228# More robust behavior (hopefully) when the user or printer is not managed
229# correctly by the Quota System : e.g. cupsFilter added in ppd file, but
230# printer and/or user not 'yet?' in storage.
231#
232# Revision 1.3  2003/02/05 23:26:22  jalet
233# Incorrect handling of grace delay
234#
235# Revision 1.2  2003/02/05 23:09:20  jalet
236# Name conflict
237#
238# Revision 1.1  2003/02/05 21:28:17  jalet
239# Initial import into CVS
240#
241#
242#
243
244import os
245import ConfigParser
246
247class PyKotaConfigError(Exception):
248    """An exception for PyKota config related stuff."""
249    def __init__(self, message = ""):
250        self.message = message
251        Exception.__init__(self, message)
252    def __repr__(self):
253        return self.message
254    __str__ = __repr__
255   
256class PyKotaConfig :
257    """A class to deal with PyKota's configuration."""
258    def __init__(self, directory) :
259        """Reads and checks the configuration file."""
260        self.isAdmin = 0
261        self.directory = directory
262        self.filename = os.path.join(directory, "pykota.conf")
263        if not os.path.isfile(self.filename) :
264            raise PyKotaConfigError, _("Configuration file %s not found.") % self.filename
265        self.config = ConfigParser.ConfigParser()
266        self.config.read([self.filename])
267           
268    def isTrue(self, option) :       
269        """Returns 1 if option is set to true, else 0."""
270        if (option is not None) and (option.upper().strip() in ['Y', 'YES', '1', 'ON', 'T', 'TRUE']) :
271            return 1
272        else :   
273            return 0
274                       
275    def getPrinterNames(self) :   
276        """Returns the list of configured printers, i.e. all sections names minus 'global'."""
277        return [pname for pname in self.config.sections() if pname != "global"]
278       
279    def getGlobalOption(self, option, ignore=0) :   
280        """Returns an option from the global section, or raises a PyKotaConfigError if ignore is not set, else returns None."""
281        try :
282            return self.config.get("global", option, raw=1)
283        except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) :   
284            if ignore :
285                return
286            else :
287                raise PyKotaConfigError, _("Option %s not found in section global of %s") % (option, self.filename)
288               
289    def getPrinterOption(self, printername, option) :   
290        """Returns an option from the printer section, or the global section, or raises a PyKotaConfigError."""
291        globaloption = self.getGlobalOption(option, ignore=1)
292        try :
293            return self.config.get(printername, option, raw=1)
294        except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) :   
295            if globaloption is not None :
296                return globaloption
297            else :
298                raise PyKotaConfigError, _("Option %s not found in section %s of %s") % (option, printername, self.filename)
299       
300    def getStorageBackend(self) :   
301        """Returns the storage backend information as a Python mapping."""       
302        backendinfo = {}
303        for option in [ "storagebackend", "storageserver", \
304                        "storagename", "storageuser", \
305                      ] :
306            backendinfo[option] = self.getGlobalOption(option)
307        backendinfo["storageuserpw"] = self.getGlobalOption("storageuserpw", ignore=1)  # password is optional
308        backendinfo["storageadmin"] = None
309        backendinfo["storageadminpw"] = None
310        adminconf = ConfigParser.ConfigParser()
311        filename = os.path.join(self.directory, "pykotadmin.conf")
312        adminconf.read([filename])
313        if adminconf.sections() : # were we able to read the file ?
314            try :
315                backendinfo["storageadmin"] = adminconf.get("global", "storageadmin", raw=1)
316            except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) :   
317                raise PyKotaConfigError, _("Option %s not found in section global of %s") % ("storageadmin", filename)
318            else :   
319                self.isAdmin = 1 # We are a PyKota administrator
320            try :
321                backendinfo["storageadminpw"] = adminconf.get("global", "storageadminpw", raw=1)
322            except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) :   
323                pass # Password is optional
324        return backendinfo
325       
326    def getLDAPInfo(self) :   
327        """Returns some hints for the LDAP backend."""       
328        ldapinfo = {}
329        for option in [ "userbase", "userrdn", \
330                        "balancebase", "balancerdn", \
331                        "groupbase", "grouprdn", "groupmembers", \
332                        "printerbase", "printerrdn", \
333                        "userquotabase", "groupquotabase", \
334                        "jobbase", "lastjobbase", \
335                        "newuser", "newgroup", \
336                        "usermail", \
337                      ] :
338            ldapinfo[option] = self.getGlobalOption(option).strip()
339        for field in ["newuser", "newgroup"] :
340            if ldapinfo[field].lower().startswith('attach(') :
341                ldapinfo[field] = ldapinfo[field][7:-1]
342               
343        # should we use TLS, by default (if unset) value is NO       
344        ldapinfo["ldaptls"] = self.isTrue(self.getGlobalOption("ldaptls", ignore=1))
345        ldapinfo["cacert"] = self.getGlobalOption("cacert", ignore=1)
346        if ldapinfo["cacert"] :
347            ldapinfo["cacert"] = ldapinfo["cacert"].strip()
348        if ldapinfo["ldaptls"] :   
349            if not os.access(ldapinfo["cacert"] or "", os.R_OK) :
350                raise PyKotaConfigError, _("Option ldaptls is set, but certificate %s is not readable.") % str(ldapinfo["cacert"])
351        return ldapinfo
352       
353    def getLoggingBackend(self) :   
354        """Returns the logging backend information."""
355        validloggers = [ "stderr", "system" ] 
356        try :
357            logger = self.getGlobalOption("logger").lower()
358        except PyKotaConfigError :   
359            logger = "system"
360        if logger not in validloggers :             
361            raise PyKotaConfigError, _("Option logger only supports values in %s") % str(validloggers)
362        return logger   
363       
364    def getAccounterBackend(self, printername) :   
365        """Returns the accounter backend to use for a given printer.
366       
367           if it is not set, it defaults to 'hardware' which means ask printer
368           for its internal lifetime page counter.
369        """   
370        validaccounters = [ "hardware", "software" ]     
371        fullaccounter = self.getPrinterOption(printername, "accounter").strip()
372        flower = fullaccounter.lower()
373        if flower.startswith("software") or flower.startswith("hardware") :   
374            try :
375                (accounter, args) = [x.strip() for x in fullaccounter.split('(', 1)]
376            except ValueError :   
377                raise PyKotaConfigError, _("Invalid accounter %s for printer %s") % (fullaccounter, printername)
378            if args.endswith(')') :
379                args = args[:-1]
380            if not args :
381                raise PyKotaConfigError, _("Invalid accounter %s for printer %s") % (fullaccounter, printername)
382            return (accounter.lower(), args)   
383        else :
384            raise PyKotaConfigError, _("Option accounter in section %s only supports values in %s") % (printername, str(validaccounters))
385       
386    def getPreHook(self, printername) :   
387        """Returns the prehook command line to launch, or None if unset."""
388        try :
389            return self.getPrinterOption(printername, "prehook").strip()
390        except PyKotaConfigError :   
391            return      # No command to launch in the pre-hook
392           
393    def getPostHook(self, printername) :   
394        """Returns the posthook command line to launch, or None if unset."""
395        try :
396            return self.getPrinterOption(printername, "posthook").strip()
397        except PyKotaConfigError :   
398            return      # No command to launch in the post-hook
399           
400    def getPrinterEnforcement(self, printername) :   
401        """Returns if quota enforcement should be strict or laxist for the current printer."""
402        validenforcements = [ "STRICT", "LAXIST" ]     
403        try :
404            enforcement = self.getPrinterOption(printername, "enforcement")
405        except PyKotaConfigError :   
406            return "LAXIST"
407        else :   
408            enforcement = enforcement.upper()
409            if enforcement not in validenforcements :
410                raise PyKotaConfigError, _("Option enforcement in section %s only supports values in %s") % (printername, str(validenforcements))
411            return enforcement   
412           
413    def getPrinterOnAccounterError(self, printername) :   
414        """Returns what must be done whenever the accounter fails."""
415        validactions = [ "CONTINUE", "STOP" ]     
416        try :
417            action = self.getPrinterOption(printername, "onaccountererror")
418        except PyKotaConfigError :   
419            return "STOP"
420        else :   
421            action = action.upper()
422            if action not in validactions :
423                raise PyKotaConfigError, _("Option onaccountererror in section %s only supports values in %s") % (printername, str(validactions))
424            return action 
425           
426    def getPrinterPolicy(self, printername) :   
427        """Returns the default policy for the current printer."""
428        validpolicies = [ "ALLOW", "DENY", "EXTERNAL" ]     
429        try :
430            fullpolicy = self.getPrinterOption(printername, "policy")
431        except PyKotaConfigError :   
432            return ("DENY", None)
433        else :   
434            try :
435                policy = [x.strip() for x in fullpolicy.split('(', 1)]
436            except ValueError :   
437                raise PyKotaConfigError, _("Invalid policy %s for printer %s") % (fullpolicy, printername)
438            if len(policy) == 1 :   
439                policy.append("")
440            (policy, args) = policy   
441            if args.endswith(')') :
442                args = args[:-1]
443            policy = policy.upper()   
444            if (policy == "EXTERNAL") and not args :
445                raise PyKotaConfigError, _("Invalid policy %s for printer %s") % (fullpolicy, printername)
446            if policy not in validpolicies :
447                raise PyKotaConfigError, _("Option policy in section %s only supports values in %s") % (printername, str(validpolicies))
448            return (policy, args)
449       
450    def getCrashRecipient(self) :   
451        """Returns the email address of the software crash messages recipient."""
452        try :
453            return self.getGlobalOption("crashrecipient")
454        except :   
455            return
456           
457    def getSMTPServer(self) :   
458        """Returns the SMTP server to use to send messages to users."""
459        try :
460            return self.getGlobalOption("smtpserver")
461        except PyKotaConfigError :   
462            return "localhost"
463       
464    def getMailDomain(self) :   
465        """Returns the mail domain to use to send messages to users."""
466        try :
467            return self.getGlobalOption("maildomain")
468        except PyKotaConfigError :   
469            return 
470       
471    def getAdminMail(self, printername) :   
472        """Returns the Email address of the Print Quota Administrator."""
473        try :
474            return self.getPrinterOption(printername, "adminmail")
475        except PyKotaConfigError :   
476            return "root@localhost"
477       
478    def getAdmin(self, printername) :   
479        """Returns the full name of the Print Quota Administrator."""
480        try :
481            return self.getPrinterOption(printername, "admin")
482        except PyKotaConfigError :   
483            return "root"
484       
485    def getMailTo(self, printername) :   
486        """Returns the recipient of email messages."""
487        validmailtos = [ "EXTERNAL", "NOBODY", "NONE", "NOONE", "BITBUCKET", "DEVNULL", "BOTH", "USER", "ADMIN" ]
488        try :
489            fullmailto = self.getPrinterOption(printername, "mailto")
490        except PyKotaConfigError :   
491            return ("BOTH", None)
492        else :   
493            try :
494                mailto = [x.strip() for x in fullmailto.split('(', 1)]
495            except ValueError :   
496                raise PyKotaConfigError, _("Invalid option mailto %s for printer %s") % (fullmailto, printername)
497            if len(mailto) == 1 :   
498                mailto.append("")
499            (mailto, args) = mailto   
500            if args.endswith(')') :
501                args = args[:-1]
502            mailto = mailto.upper()   
503            if (mailto == "EXTERNAL") and not args :
504                raise PyKotaConfigError, _("Invalid option mailto %s for printer %s") % (fullmailto, printername)
505            if mailto not in validmailtos :
506                raise PyKotaConfigError, _("Option mailto in section %s only supports values in %s") % (printername, str(validmailtos))
507            return (mailto, args)
508       
509    def getGraceDelay(self, printername) :   
510        """Returns the grace delay in days."""
511        try :
512            gd = self.getPrinterOption(printername, "gracedelay")
513        except PyKotaConfigError :   
514            gd = 7      # default value of 7 days
515        try :
516            return int(gd)
517        except (TypeError, ValueError) :   
518            raise PyKotaConfigError, _("Invalid grace delay %s") % gd
519           
520    def getPoorMan(self) :   
521        """Returns the poor man's threshold."""
522        try :
523            pm = self.getGlobalOption("poorman")
524        except PyKotaConfigError :   
525            pm = 1.0    # default value of 1 unit
526        try :
527            return float(pm)
528        except (TypeError, ValueError) :   
529            raise PyKotaConfigError, _("Invalid poor man's threshold %s") % pm
530           
531    def getPoorWarn(self) :   
532        """Returns the poor man's warning message."""
533        try :
534            return self.getGlobalOption("poorwarn")
535        except PyKotaConfigError :   
536            return _("Your Print Quota account balance is Low.\nSoon you'll not be allowed to print anymore.\nPlease contact the Print Quota Administrator to solve the problem.")
537           
538    def getHardWarn(self, printername) :   
539        """Returns the hard limit error message."""
540        try :
541            return self.getPrinterOption(printername, "hardwarn")
542        except PyKotaConfigError :   
543            return _("You are not allowed to print anymore because\nyour Print Quota is exceeded on printer %s.") % printername
544           
545    def getSoftWarn(self, printername) :   
546        """Returns the soft limit error message."""
547        try :
548            return self.getPrinterOption(printername, "softwarn")
549        except PyKotaConfigError :   
550            return _("You will soon be forbidden to print anymore because\nyour Print Quota is almost reached on printer %s.") % printername
551           
552    def getPrivacy(self) :       
553        """Returns 1 if privacy is activated, else 0."""
554        return self.isTrue(self.getGlobalOption("privacy", ignore=1))
555       
556    def getDebug(self) :         
557        """Returns 1 if debugging is activated, else 0."""
558        return self.isTrue(self.getGlobalOption("debug", ignore=1))
559           
560    def getCaching(self) :         
561        """Returns 1 if database caching is enabled, else 0."""
562        return self.isTrue(self.getGlobalOption("storagecaching", ignore=1))
563           
564    def getLDAPCache(self) :         
565        """Returns 1 if low-level LDAP caching is enabled, else 0."""
566        return self.isTrue(self.getGlobalOption("ldapcache", ignore=1))
567           
568    def getDisableHistory(self) :         
569        """Returns 1 if we want to disable history, else 0."""
570        return self.isTrue(self.getGlobalOption("disablehistory", ignore=1))
571           
572    def getUserNameToLower(self) :         
573        """Returns 1 if we want to convert usernames to lowercase when printing, else 0."""
574        return self.isTrue(self.getGlobalOption("utolower", ignore=1))
575       
576    def getRejectUnknown(self) :         
577        """Returns 1 if we want to reject the creation of unknown users or groups, else 0."""
578        return self.isTrue(self.getGlobalOption("reject_unknown", ignore=1))
579       
580    def getWinbindSeparator(self) :         
581        """Returns the winbind separator's value if it is set, else None."""
582        return self.getGlobalOption("winbind_separator", ignore=1)
583
584    def getAccountBanner(self, printername) :
585        """Returns which banner(s) to account for: NONE, BOTH, STARTING, ENDING."""
586        validvalues = [ "NONE", "BOTH", "STARTING", "ENDING" ]     
587        try :
588            value = self.getPrinterOption(printername, "accountbanner")
589        except PyKotaConfigError :   
590            return "BOTH"       # Default value of BOTH
591        else :   
592            value = value.strip().upper()
593            if value not in validvalues :
594                raise PyKotaConfigError, _("Option accountbanner in section %s only supports values in %s") % (printername, str(validvalues))
595            return value 
596
597    def getStartingBanner(self, printername) :
598        """Returns the startingbanner value if set, else None."""
599        try :
600            return self.getPrinterOption(printername, "startingbanner").strip()
601        except PyKotaConfigError :
602            return None
603
604    def getEndingBanner(self, printername) :
605        """Returns the endingbanner value if set, else None."""
606        try :
607            return self.getPrinterOption(printername, "endingbanner").strip()
608        except PyKotaConfigError :
609            return None
Note: See TracBrowser for help on using the browser.