def expand_macro(self, formatter, name, txt): if txt: sourcepage = txt.strip('"') else: sourcepage = 'Fortune Cookies' wikiobj = randomwiki(self.env.get_db_cnx()) pagelist = wikiobj.getentries(sourcepage,1) if pagelist[0]: pagelist[0] = pagelist[0].replace('*','') return format_to_html(self.env,formatter.context,pagelist[0]) else: return "Quotes not found"
def expand_macro(self, formatter, name, txt): (sourcepage,number) = txt.split(',') sourcepage = sourcepage.strip('"') if number is None: number = 1 else: number = int(number) out = '' wikiobj = randomwiki(self.env.get_db_cnx()) pagelist = wikiobj.getentries(sourcepage,number) for page in pagelist: page = self.fixup_images(page,sourcepage) out += format_to_html(self.env,formatter.context,page) return out
def expand_macro(self, formatter, name, txt): (sourcepage, number) = txt.split(',') sourcepage = sourcepage.strip('"') if number is None: number = 1 else: number = int(number) out = '' wikiobj = randomwiki(self.env.get_db_cnx()) pagelist = wikiobj.getentries(sourcepage, number) for page in pagelist: page = self.fixup_images(page, sourcepage) out += format_to_html(self.env, formatter.context, page) return out