mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
If the file name passed to parse_GL_API is None or "-", read from standard
input. This allows use of GL API scripts in pipelines.
This commit is contained in:
parent
93d2d54e7a
commit
d03ab104db
1 changed files with 7 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ from xml.sax import make_parser
|
||||||
from xml.sax.handler import feature_namespaces
|
from xml.sax.handler import feature_namespaces
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
def is_attr_true( attrs, name ):
|
def is_attr_true( attrs, name ):
|
||||||
"""Read a name value from an element's attributes.
|
"""Read a name value from an element's attributes.
|
||||||
|
|
@ -55,12 +56,17 @@ def parse_GL_API( handler, file_name ):
|
||||||
supplied SAX callback, which should be derived from
|
supplied SAX callback, which should be derived from
|
||||||
FilterGLAPISpecBase.
|
FilterGLAPISpecBase.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
parser = make_parser()
|
parser = make_parser()
|
||||||
parser.setFeature(feature_namespaces, 1)
|
parser.setFeature(feature_namespaces, 1)
|
||||||
parser.setContentHandler( handler )
|
parser.setContentHandler( handler )
|
||||||
|
|
||||||
handler.printHeader()
|
handler.printHeader()
|
||||||
parser.parse( file_name )
|
|
||||||
|
if not file_name or file_name == "-":
|
||||||
|
parser.parse( sys.stdin )
|
||||||
|
else:
|
||||||
|
parser.parse( file_name )
|
||||||
|
|
||||||
handler.printFooter()
|
handler.printFooter()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue