def constructPipeline(transmogrifier, sections, pipeline=None): """Construct a transmogrifier pipeline ``sections`` is a list of pipeline section ids. Start the pipeline with ``pipeline``, or if that's None, with an empty iterator. """ if pipeline is None: pipeline = iter(()) # empty starter section for section_id in sections: section_id = section_id.strip() if not section_id: continue section_options = transmogrifier[section_id] blueprint_id = section_options['blueprint'].decode('ascii') blueprint = getUtility(ISectionBlueprint, blueprint_id) pipeline = blueprint(transmogrifier, section_id, section_options, pipeline) if not ISection.providedBy(pipeline): raise ValueError('Blueprint %s for section %s did not return ' 'an ISection' % (blueprint_id, section_id)) pipeline = iter(pipeline) # ensure you can call .next() return pipeline
def test_implements_interface(self): klass = resolvetree.ResolveTree self.assertTrue(ISection.implementedBy(klass), 'Class %s does not implement ISection.' % str(klass)) verifyClass(ISection, klass) self.assertTrue(ISectionBlueprint.providedBy(klass), 'Class %s does not provide ISectionBlueprint.' % str(klass)) verifyObject(ISectionBlueprint, klass)
def test_implements_interface(self): klass = singleitemsource.SingleItemSource self.assertTrue(ISection.implementedBy(klass), 'Class %s does not implement ISection.' % str(klass)) verifyClass(ISection, klass) self.assertTrue(ISectionBlueprint.providedBy(klass), 'Class %s does not provide ISectionBlueprint.' % ( str(klass))) verifyObject(ISectionBlueprint, klass)
def test_implements_interface(self): klass = translate.Translate self.assertTrue(ISection.implementedBy(klass), 'Class %s does not implement ISection.' % str(klass)) verifyClass(ISection, klass) self.assertTrue( ISectionBlueprint.providedBy(klass), 'Class %s does not provide ISectionBlueprint.' % (str(klass))) verifyObject(ISectionBlueprint, klass)
def test_implements_interface(self): klass = translate.Translate self.assertTrue(ISection.implementedBy(klass), 'Class %s does not implement ISection.' % str(klass)) verifyClass(ISection, klass) self.assertTrue(ISectionBlueprint.providedBy(klass), 'Class %s does not provide ISectionBlueprint.' % ( str(klass))) verifyObject(ISectionBlueprint, klass)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(ConstructorSection)) verifyClass(ISection, ConstructorSection) self.assertTrue(ISectionBlueprint.providedBy(ConstructorSection)) verifyObject(ISectionBlueprint, ConstructorSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(ResolveGUIDSection)) verifyClass(ISection, ResolveGUIDSection) self.assertTrue(ISectionBlueprint.providedBy(ResolveGUIDSection)) verifyObject(ISectionBlueprint, ResolveGUIDSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(FileLoaderSection)) verifyClass(ISection, FileLoaderSection) self.assertTrue(ISectionBlueprint.providedBy(FileLoaderSection)) verifyObject(ISectionBlueprint, FileLoaderSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(ConstructorSection)) verifyClass(ISection, ConstructorSection) self.assertTrue(ISectionBlueprint.providedBy(ConstructorSection)) verifyObject(ISectionBlueprint, ConstructorSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(BundleSourceSection)) verifyClass(ISection, BundleSourceSection) self.assertTrue(ISectionBlueprint.providedBy(BundleSourceSection)) verifyObject(ISectionBlueprint, BundleSourceSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(BundleSourceSection)) verifyClass(ISection, BundleSourceSection) self.assertTrue(ISectionBlueprint.providedBy(BundleSourceSection)) verifyObject(ISectionBlueprint, BundleSourceSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(FileLoaderSection)) verifyClass(ISection, FileLoaderSection) self.assertTrue(ISectionBlueprint.providedBy(FileLoaderSection)) verifyObject(ISectionBlueprint, FileLoaderSection)
def test_implements_interface(self): self.assertTrue(ISection.implementedBy(ResolveGUIDSection)) verifyClass(ISection, ResolveGUIDSection) self.assertTrue(ISectionBlueprint.providedBy(ResolveGUIDSection)) verifyObject(ISectionBlueprint, ResolveGUIDSection)