Changeset 597 for tea4cups/trunk/tea4cups
- Timestamp:
- 03/16/05 21:16:13 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
tea4cups/trunk/tea4cups
r590 r597 37 37 from struct import unpack 38 38 39 version = "1. 00"39 version = "1.5alpha" 40 40 41 41 class TeeError(Exception): … … 278 278 raise ConfigError, "Option %s not found in section [%s] of %s" % (option, printqueuename, self.conffile) 279 279 280 def enumTeeBranches(self, printqueuename) : 281 """Returns the list of branches for a particular section's Tee.""" 282 try : 283 globalbranches = [ (k, v) for (k, v) in self.config.items("global") if k.startswith("tee_") ] 280 def enumBranches(self, printqueuename, branchtype="tee") : 281 """Returns the list of branchtypes branches for a particular section's.""" 282 branchbasename = "%s_" % branchtype.lower() 283 try : 284 globalbranches = [ (k, v) for (k, v) in self.config.items("global") if k.startswith(branchbasename) ] 284 285 except ConfigParser.NoSectionError, msg : 285 286 raise ConfigError, "Invalid configuration file : %s" % msg 286 287 try : 287 sectionbranches = [ (k, v) for (k, v) in self.config.items(printqueuename) if k.startswith( "tee_") ]288 sectionbranches = [ (k, v) for (k, v) in self.config.items(printqueuename) if k.startswith(branchbasename) ] 288 289 except ConfigParser.NoSectionError, msg : 289 290 self.logInfo("No section for print queue %s : %s" % (printqueuename, msg)) … … 529 530 exitcode = 0 530 531 signal.signal(signal.SIGTERM, self.sigtermHandler) 531 branches = self.enumTeeBranches(self.PrinterName) 532 prehooks = self.enumBranches(self.PrinterName, "prehook") 533 branches = self.enumBranches(self.PrinterName, "tee") 534 prehooks = self.enumBranches(self.PrinterName, "posthook") 532 535 if self.isTrue(self.getPrintQueueOption(self.PrinterName, "serialize", ignore=1)) : 533 536 self.logDebug("Serialized Tees")