def po2dtd(self, posource, remove_untranslated=False): """helper that converts po source to dtd source without requiring files""" inputfile = wStringIO.StringIO(posource) inputpo = po.pofile(inputfile) convertor = po2dtd.po2dtd(remove_untranslated=remove_untranslated) outputdtd = convertor.convertstore(inputpo) return outputdtd
def po2dtd(posource, remove_untranslated=False): """helper that converts po source to dtd source without requiring files""" inputfile = BytesIO(posource.encode()) inputpo = po.pofile(inputfile) convertor = po2dtd.po2dtd(remove_untranslated=remove_untranslated) return convertor.convertstore(inputpo)