def php2po(self, phpsource, phptemplate=None): """helper that converts .php source to po source without requiring files""" inputfile = BytesIO(phpsource.encode()) output_file = BytesIO() templatefile = None if phptemplate: templatefile = BytesIO(phptemplate.encode()) convertor = php2po.php2po(inputfile, output_file, templatefile) convertor.run() return convertor.target_store
def php2po(self, phpsource, phptemplate=None): """helper that converts .php source to po source without requiring files""" inputfile = wStringIO.StringIO(phpsource) output_file = wStringIO.StringIO() templatefile = None if phptemplate: templatefile = wStringIO.StringIO(phptemplate) convertor = php2po.php2po(inputfile, output_file, templatefile) convertor.run() return convertor.target_store
def php2po(self, phpsource, phptemplate=None): """helper that converts .phperties source to po source without requiring files""" inputfile = wStringIO.StringIO(phpsource) inputphp = php.phpfile(inputfile) convertor = php2po.php2po() if phptemplate: templatefile = wStringIO.StringIO(phptemplate) templatephp = php.phpfile(templatefile) outputpo = convertor.mergestore(templatephp, inputphp) else: outputpo = convertor.convertstore(inputphp) return outputpo
def php2po(self, phpsource, phptemplate=None): """helper that converts .php source to po source without requiring files""" inputfile = wStringIO.StringIO(phpsource) inputphp = php.phpfile(inputfile) convertor = php2po.php2po() if phptemplate: templatefile = wStringIO.StringIO(phptemplate) templatephp = php.phpfile(templatefile) outputpo = convertor.mergestore(templatephp, inputphp) else: outputpo = convertor.convertstore(inputphp) return outputpo