From 689207d4e81fe36045dfe4cee08bfa496ef93d7e Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Sun, 7 Feb 2021 15:37:42 +0100 Subject: [PATCH] Various bugs --- opengl_registry/commands.py | 2 +- opengl_registry/reader.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/opengl_registry/commands.py b/opengl_registry/commands.py index 3ff5f49..1c6b73f 100644 --- a/opengl_registry/commands.py +++ b/opengl_registry/commands.py @@ -22,7 +22,7 @@ def name(self): @property def value(self) -> str: """str: full declaration string""" - return self._name + return self._value @property def ptype(self) -> str: diff --git a/opengl_registry/reader.py b/opengl_registry/reader.py index ca75e44..ae3e40a 100644 --- a/opengl_registry/reader.py +++ b/opengl_registry/reader.py @@ -171,6 +171,11 @@ def read_commands(self) -> Dict[str, Command]: # A command should only have one proto tag if child.tag == "proto": command.proto = "".join(child.itertext()) + try: + ptype = next(child.iter("ptype")) + command.ptype = ptype.text + except StopIteration: + pass command.name = next(child.iter("name")).text elif child.tag == "param": name = next(child.iter("name")).text