def txt2po(self, txtsource, template=None): """helper that converts txt source to po source without requiring files""" inputfile = wStringIO.StringIO(txtsource) inputtxt = txt.TxtFile(inputfile) convertor = txt2po.txt2po() outputpo = convertor.convertstore(inputtxt) return outputpo
def doku2po(self, txtsource, template=None): """helper that converts dokuwiki source to po source without requiring files.""" inputfile = wStringIO.StringIO(txtsource) inputtxt = txt.TxtFile(inputfile, flavour="dokuwiki") convertor = txt2po.txt2po() outputpo = convertor.convertstore(inputtxt) return outputpo