Changeset 783
- Timestamp:
- 02/10/03 09:19:57 (22 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r782 r783 58 58 # snmp(public, 43.10.2.1.4.1.1) 59 59 # are equivalent 60 # WARNING : external doesn't work yet because of ConfigParser 61 # which tries to do the %(printer)s substitution itself 62 requester: snmp(public, 43.10.2.1.4.1.1) 60 # requester: snmp(public, 43.10.2.1.4.1.1) 61 external(snmpget -c public -Ov %(printer)s 43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 63 62 # 64 63 # Default policy for inexistant users (e.g. root) -
pykota/trunk/pykota/config.py
r781 r783 15 15 # 16 16 # $Log$ 17 # Revision 1.10 2003/02/10 08:19:57 jalet 18 # tell ConfigParser to return raw data, this allows our own strings 19 # interpolations in the requester 20 # 17 21 # Revision 1.9 2003/02/10 00:44:38 jalet 18 22 # Typos … … 85 89 # more precise checks 86 90 validloggers = [ "stderr", "system" ] 87 if self.config.get("global", "logger" ).lower() not in validloggers :91 if self.config.get("global", "logger", raw=1).lower() not in validloggers : 88 92 raise PyKotaConfigError, _("Option logger only supports values in %s") % str(validloggers) 89 93 90 94 validmethods = [ "lazy" ] # TODO add more methods 91 if self.config.get("global", "method" ).lower() not in validmethods :95 if self.config.get("global", "method", raw=1).lower() not in validmethods : 92 96 raise PyKotaConfigError, _("Option method only supports values in %s") % str(validmethods) 93 97 … … 99 103 100 104 validpolicies = [ "ALLOW", "DENY" ] 101 if self.config.get(printer, "policy" ).upper() not in validpolicies :105 if self.config.get(printer, "policy", raw=1).upper() not in validpolicies : 102 106 raise PyKotaConfigError, _("Option policy in section %s only supports values in %s") % (printer, str(validpolicies)) 103 107 104 108 validrequesters = [ "snmp", "external" ] # TODO : add more requesters 105 fullrequester = self.config.get(printer, "requester" )109 fullrequester = self.config.get(printer, "requester", raw=1) 106 110 try : 107 111 (requester, args) = [x.strip() for x in fullrequester.split('(')] … … 128 132 "storageuser", # TODO : "storageadminpw", "storageusepw", \ 129 133 ] : 130 backendinfo.append(self.config.get("global", option ))134 backendinfo.append(self.config.get("global", option, raw=1)) 131 135 return tuple(backendinfo) 132 136 133 137 def getLoggingBackend(self) : 134 138 """Returns the logging backend information.""" 135 return self.config.get("global", "logger" ).lower()139 return self.config.get("global", "logger", raw=1).lower() 136 140 137 141 def getRequesterBackend(self, printer) : 138 142 """Returns the requester backend to use for a given printer, with its arguments.""" 139 fullrequester = self.config.get(printer, "requester" )143 fullrequester = self.config.get(printer, "requester", raw=1) 140 144 (requester, args) = [x.strip() for x in fullrequester.split('(')] 141 145 if args.endswith(')') : … … 148 152 def getPrinterPolicy(self, printer) : 149 153 """Returns the default policy for the current printer.""" 150 return self.config.get(printer, "policy" ).upper()154 return self.config.get(printer, "policy", raw=1).upper() 151 155 152 156 def getSMTPServer(self) : 153 157 """Returns the SMTP server to use to send messages to users.""" 154 return self.config.get("global", "smtpserver" ).lower()158 return self.config.get("global", "smtpserver", raw=1) 155 159 156 160 def getAdminMail(self) : 157 161 """Returns the Email address of the Print Quota Administrator.""" 158 return self.config.get("global", "adminmail" )162 return self.config.get("global", "adminmail", raw=1) 159 163 160 164 def getAdmin(self) : 161 165 """Returns the full name of the Print Quota Administrator.""" 162 return self.config.get("global", "admin" )166 return self.config.get("global", "admin", raw=1) 163 167 164 168 def getGraceDelay(self) : 165 169 """Returns the grace delay in days.""" 166 gd = self.config.get("global", "gracedelay" )170 gd = self.config.get("global", "gracedelay", raw=1) 167 171 try : 168 172 return int(gd)