def po2sub(self, posource): """helper that converts po source to subtitle source without requiring files""" inputfile = BytesIO(posource.encode()) inputpo = po.pofile(inputfile) convertor = po2sub.po2sub() outputsub = convertor.convert_store(inputpo) return outputsub.decode("utf-8")
def po2sub(self, posource): """helper that converts po source to subtitle source without requiring files""" inputfile = wStringIO.StringIO(posource) inputpo = po.pofile(inputfile) convertor = po2sub.po2sub() outputsub = convertor.convert_store(inputpo) return outputsub.decode('utf-8')
def po2sub(self, posource): """helper that converts po source to subtitle source without requiring files""" inputfile = wStringIO.StringIO(posource) inputpo = po.pofile(inputfile) convertor = po2sub.po2sub() outputsub = convertor.convertstore(inputpo) return outputsub.decode('utf-8')
def merge2sub(self, subsource, posource): """helper that merges po translations to subtitle source without requiring files""" inputfile = BytesIO(posource.encode()) inputpo = po.pofile(inputfile) templatefile = BytesIO(subsource.encode()) convertor = po2sub.po2sub(templatefile, inputpo) outputsub = convertor.convert_store() print(outputsub) return outputsub.decode("utf-8")
def merge2sub(self, subsource, posource): """helper that merges po translations to subtitle source without requiring files""" inputfile = wStringIO.StringIO(posource) inputpo = po.pofile(inputfile) templatefile = wStringIO.StringIO(subsource) convertor = po2sub.po2sub(templatefile, inputpo) outputsub = convertor.convert_store() print(outputsub) return outputsub.decode('utf-8')