예제 #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"