コード例 #1
0
ファイル: test_pogrep.py プロジェクト: onia/translate
 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)
コード例 #2
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 tofile.serialize()
コード例 #3
0
ファイル: test_pogrep.py プロジェクト: onia/translate
 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)
コード例 #4
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(tofile.serialize())
     return tofile.serialize()