def getEbook(self): """ Retrieve the Ebook """ obj = self.context portal_url = getToolByName(obj, 'portal_url') portal = portal_url.getPortalObject() while not IImportedBook.providedBy(obj) \ and aq_base(obj) is not aq_base(portal): obj = utils.parent(obj) return obj
def test_folderStructure(self): """ Tests the folderStructure of the epub contenttype """ self.failUnless(self.rootEpubFolder is not None) self.failUnless(IImportedBook.providedBy(self.rootEpubFolder)) chapter = getattr(self.rootEpubFolder, 'chapter1.xhtml') self.failUnless(IImportedChapter.providedBy(chapter)) self.failUnless(chapter.Title() == 'Climate change impact in Europe') self.failUnless(chapter.Description() == \ "The earth's climate has not changed many times in the course " "of its long history. Most of these changes occurred over " "hundreds, thousands or millions of years and were driven by " "natural phenomena such as variations in the Earth's orbit " "around the sun, variations in the Earth's axis, fluctuations " "in the sun's activity and volcanic eruptions.") chapter = getattr(self.rootEpubFolder, 'cover.xhtml') self.failUnless(chapter.portal_type == "Document")
def isImportedEbook(self): """ Boolean if Epub IImportedBook is provided by current context """ return IImportedBook.providedBy(self.context)