def getBlurb(self, topic, cnt=None, addPeriod=True): """Answer a generated article text with the estimated cnt length.""" txt = Blurb().getBlurb(topic, cnt=cnt) while txt and txt[-1] in ',:;-': txt = txt[:-1] if addPeriod and not txt.endswith('.'): txt += '.' elif txt.endswith('.'): txt = txt[:-1] #txt = txt.capitalize() return txt
def getAnkeiler(self, cnt=None): u"""Answer a blurb ankeiler. Make sure it does end with '.'""" ankeiler = Blurb().getBlurb('article_ankeiler', cnt=cnt) while ankeiler and ankeiler[-1] in ',:;-': ankeiler = ankeiler[:-1] if not ankeiler.endswith('.'): ankeiler += '.' return ankeiler