예제 #1
0
 def po2txt(self, posource, txttemplate=None):
     """helper that converts po source to txt source without requiring files"""
     inputfile = wStringIO.StringIO(posource)
     print inputfile.getvalue()
     outputfile = wStringIO.StringIO()
     if txttemplate:
         templatefile = wStringIO.StringIO(txttemplate)
     else:
         templatefile = None
     assert po2txt.converttxt(inputfile, outputfile, templatefile)
     print outputfile.getvalue()
     return outputfile.getvalue()
예제 #2
0
 def po2txt(self, posource, txttemplate=None):
     """helper that converts po source to txt source without requiring files"""
     inputfile = wStringIO.StringIO(posource)
     print inputfile.getvalue()
     outputfile = wStringIO.StringIO()
     if txttemplate:
         templatefile = wStringIO.StringIO(txttemplate)
     else:
         templatefile = None
     assert po2txt.converttxt(inputfile, outputfile, templatefile)
     print outputfile.getvalue()
     return outputfile.getvalue()