| 192 | def getPreAccounterBackend(self, printername) : |
| 193 | """Returns the preaccounter backend to use for a given printer.""" |
| 194 | validaccounters = [ "software" ] |
| 195 | try : |
| 196 | fullaccounter = self.getPrinterOption(printername, "preaccounter").strip() |
| 197 | except PyKotaConfigError : |
| 198 | return ("software", "") |
| 199 | else : |
| 200 | flower = fullaccounter.lower() |
| 201 | if flower.startswith("software") : |
| 202 | try : |
| 203 | (accounter, args) = [x.strip() for x in fullaccounter.split('(', 1)] |
| 204 | except ValueError : |
| 205 | raise PyKotaConfigError, _("Invalid preaccounter %s for printer %s") % (fullaccounter, printername) |
| 206 | if args.endswith(')') : |
| 207 | args = args[:-1].strip() |
| 208 | return ("software", args) |
| 209 | else : |
| 210 | raise PyKotaConfigError, _("Option preaccounter in section %s only supports values in %s") % (printername, str(validaccounters)) |
| 211 | |