diff options
author | Ian Romanick <[email protected]> | 2005-04-14 23:00:34 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-04-14 23:00:34 +0000 |
commit | 73b4c1b3885bacb3a0ec5be645dbfbbefb99b658 (patch) | |
tree | 6a97513896a7c9554027e0a81ebc784294190edc /src/mesa/glapi/glX_XML.py | |
parent | a3deff2404403fb75089c731d4189dd59ced21c0 (diff) |
Refactor the handling of the '(true | false)' enumerated attributes.
Diffstat (limited to 'src/mesa/glapi/glX_XML.py')
-rw-r--r-- | src/mesa/glapi/glX_XML.py | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py index 4c16a68cb6b..e48955e34e7 100644 --- a/src/mesa/glapi/glX_XML.py +++ b/src/mesa/glapi/glX_XML.py @@ -359,31 +359,11 @@ class glXFunction(gl_XML.glFunction): else: raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name)) - - if attrs.get('ignore', "false") == "true": - self.ignore = 1 - else: - self.ignore = 0 - - if attrs.get('large', "false") == "true": - self.can_be_large = 1 - else: - self.can_be_large = 0 - - if attrs.get('doubles_in_order', "false") == "true": - self.glx_doubles_in_order = 1 - else: - self.glx_doubles_in_order = 0 - - if attrs.get('always_array', "false") == "true": - self.reply_always_array = 1 - else: - self.reply_always_array = 0 - - if attrs.get('dimensions_in_reply', "false") == "true": - self.dimensions_in_reply = 1 - else: - self.dimensions_in_reply = 0 + self.ignore = gl_XML.is_attr_true( attrs, 'ignore' ) + self.can_be_large = gl_XML.is_attr_true( attrs, 'large' ) + self.glx_doubles_in_order = gl_XML.is_attr_true( attrs, 'doubles_in_order' ) + self.reply_always_array = gl_XML.is_attr_true( attrs, 'always_array' ) + self.dimensions_in_reply = gl_XML.is_attr_true( attrs, 'dimensions_in_reply' ) else: gl_XML.glFunction.startElement(self, name, attrs) |