コード例 #1
0
ファイル: ts.py プロジェクト: flyeven/translate
 def __init__(self, inputfile=None):
     """make a new QtTsParser, reading from the given inputfile if required"""
     self.filename = getattr(inputfile, "filename", None)
     self.knowncontextnodes = {}
     self.indexcontextnodes = {}
     if inputfile is None:
         self.document = ourdom.parseString("<!DOCTYPE TS><TS></TS>")
     else:
         self.document = ourdom.parse(inputfile)
         assert self.document.documentElement.tagName == "TS"
コード例 #2
0
 def __init__(self, inputfile=None):
     """make a new QtTsParser, reading from the given inputfile if required"""
     self.filename = getattr(inputfile, "filename", None)
     self.knowncontextnodes = {}
     self.indexcontextnodes = {}
     if inputfile is None:
         self.document = ourdom.parseString("<!DOCTYPE TS><TS></TS>")
     else:
         self.document = ourdom.parse(inputfile)
         assert self.document.documentElement.tagName == "TS"