mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 15:20:26 +01:00
Add the ability to include other XML files by using a
<include name="file"/> element as a sub-element of <OpenGLAPI>.
This commit is contained in:
parent
463642c0be
commit
6cfd4f7e55
1 changed files with 10 additions and 0 deletions
|
|
@ -611,6 +611,8 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
|
|||
self.current_object.startElement(name, attrs)
|
||||
elif name == "category":
|
||||
self.current_category = attrs.get('name', "")
|
||||
elif name == "include":
|
||||
self.next_include = attrs.get('name', "")
|
||||
else:
|
||||
self.current_object = self.factory.create(self, name, attrs)
|
||||
return
|
||||
|
|
@ -620,6 +622,14 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
|
|||
if self.current_object != None:
|
||||
if self.current_object.endElement(name):
|
||||
self.current_object = None
|
||||
elif name == "include":
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(self)
|
||||
|
||||
f = open(self.next_include)
|
||||
parser.parse(f)
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue