def setUp(self): confBase = { 'sep': '/' } confA, confB = confBase.copy(), confBase.copy() confA['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_A') confB['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_B') self.driverA = loadDriver(drivers.Maildir, 'MaildirA', confA) self.driverB = loadDriver(drivers.Maildir, 'MaildirB', confB)
def setUp(self): confBase = {'sep': '/'} confA, confB = confBase.copy(), confBase.copy() confA['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_A') confB['path'] = os.path.join(libcore.testingPath(), 'maildirs', 'recursive_B') self.driverA = loadDriver(drivers.Maildir, 'MaildirA', confA) self.driverB = loadDriver(drivers.Maildir, 'MaildirB', confB)
def fw_getDriver(self): """Chain the controllers on top of the driver. Controllers are run in the driver worker.""" driver = loadDriver(self.driver, self.getClassName(), self.conf) # Chain the controllers. controllers = self.controllers # Keep the original attribute as-is. # Nearest to end-driver is the last in this list. controllers.reverse() for obj in controllers: controller = loadController(obj, self.getClassName()) controller.fw_drive(driver) # Chain here. driver = controller # The next controller will drive this. return driver
def fw_getDriver(self) -> Driver: """Chain the controllers on top of the driver. Controllers are run in the driver worker.""" driver = loadDriver(self.driver, self.getClassName(), self.conf) # Chain the controllers. # Keep the original attribute as-is. controllers = self.controllers.copy() # Nearest to end-driver is the last in this list. controllers.reverse() for obj in controllers: controller = loadController(obj, self.getClassName(), self.conf) controller.fw_drive(driver) # Chain here. driver = controller # The next controller will drive this. return driver