Exemple #1
0
 def xliff_grep(self, xliff_text, searchstring, cmdlineoptions=None):
     """helper that parses xliff text and passes it through a filter"""
     if cmdlineoptions is None:
         cmdlineoptions = []
     options, args = pogrep.cmdlineparser().parse_args(["xxx.xliff"] + cmdlineoptions)
     grepfilter = pogrep.GrepFilter(searchstring, options.searchparts, options.ignorecase, options.useregexp, options.invertmatch, options.accelchar)
     tofile = grepfilter.filterfile(self.xliff_parse(xliff_text))
     return str(tofile)
Exemple #2
0
 def pogrep(self, posource, searchstring, cmdlineoptions=None):
     """helper that parses po source and passes it through a filter"""
     if cmdlineoptions is None:
         cmdlineoptions = []
     options, args = pogrep.cmdlineparser().parse_args(["xxx.po"] + cmdlineoptions)
     grepfilter = pogrep.GrepFilter(searchstring, options.searchparts, options.ignorecase, options.useregexp, options.invertmatch, options.keeptranslations, options.accelchar)
     tofile = grepfilter.filterfile(self.poparse(posource))
     print(str(tofile))
     return str(tofile)