mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-21 21:35:06 +00:00
Use list comprehension instead of extending the collection
This commit is contained in:
parent
4e5fe20519
commit
107ab7f6e9
@ -43,12 +43,7 @@ def findParams(node):
|
||||
return ( t, n.strip())
|
||||
|
||||
def findEnums(dom):
|
||||
ret = {}
|
||||
for i in findChildren(dom, [ 'registry', 'enums', 'enum' ]):
|
||||
n = i.getAttribute('name')
|
||||
v = i.getAttribute('value')
|
||||
ret[n] = v
|
||||
return ret
|
||||
return {i.getAttribute('name'): i.getAttribute('value') for i in findChildren(dom, [ 'registry', 'enums', 'enum' ])}
|
||||
|
||||
def findCommands(dom):
|
||||
ret = {}
|
||||
@ -62,12 +57,8 @@ def findFeatures(dom):
|
||||
ret = {}
|
||||
for i in findChildren(dom, [ 'registry', 'feature' ]):
|
||||
n = i.getAttribute('name')
|
||||
e = []
|
||||
c = []
|
||||
for j in findChildren(i, [ 'require', 'enum' ]):
|
||||
e.append(j.getAttribute("name"))
|
||||
for j in findChildren(i, [ 'require', 'command' ]):
|
||||
c.append(j.getAttribute("name"))
|
||||
e = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'enum' ])]
|
||||
c = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'command' ])]
|
||||
ret[n] = (e,c)
|
||||
return ret
|
||||
|
||||
@ -75,12 +66,8 @@ def findExtensions(dom):
|
||||
ret = {}
|
||||
for i in findChildren(dom, [ 'registry', 'extensions', 'extension' ]):
|
||||
n = i.getAttribute('name')
|
||||
e = []
|
||||
c = []
|
||||
for j in findChildren(i, [ 'require', 'enum' ]):
|
||||
e.append(j.getAttribute("name"))
|
||||
for j in findChildren(i, [ 'require', 'command' ]):
|
||||
c.append(j.getAttribute("name"))
|
||||
e = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'enum' ])]
|
||||
c = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'command' ])]
|
||||
ret[n] = (e,c)
|
||||
return ret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user