XMLReader: Allow parsing XML without <ttFont> root element
This commit is contained in:
parent
9d39007aa6
commit
3820a3006f
@ -37,7 +37,9 @@ class XMLReader(object):
|
|||||||
self.contentStack = []
|
self.contentStack = []
|
||||||
self.stackSize = 0
|
self.stackSize = 0
|
||||||
|
|
||||||
def read(self):
|
def read(self, rootless=False):
|
||||||
|
if rootless:
|
||||||
|
self.stackSize += 1
|
||||||
if self.progress:
|
if self.progress:
|
||||||
self.file.seek(0, 2)
|
self.file.seek(0, 2)
|
||||||
fileSize = self.file.tell()
|
fileSize = self.file.tell()
|
||||||
@ -46,6 +48,8 @@ class XMLReader(object):
|
|||||||
self._parseFile(self.file)
|
self._parseFile(self.file)
|
||||||
if self._closeStream:
|
if self._closeStream:
|
||||||
self.close()
|
self.close()
|
||||||
|
if rootless:
|
||||||
|
self.stackSize -= 1
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.file.close()
|
self.file.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user