mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-11-29 18:07:08 +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())
|
return ( t, n.strip())
|
||||||
|
|
||||||
def findEnums(dom):
|
def findEnums(dom):
|
||||||
ret = {}
|
return {i.getAttribute('name'): i.getAttribute('value') for i in findChildren(dom, [ 'registry', 'enums', 'enum' ])}
|
||||||
for i in findChildren(dom, [ 'registry', 'enums', 'enum' ]):
|
|
||||||
n = i.getAttribute('name')
|
|
||||||
v = i.getAttribute('value')
|
|
||||||
ret[n] = v
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def findCommands(dom):
|
def findCommands(dom):
|
||||||
ret = {}
|
ret = {}
|
||||||
@ -62,12 +57,8 @@ def findFeatures(dom):
|
|||||||
ret = {}
|
ret = {}
|
||||||
for i in findChildren(dom, [ 'registry', 'feature' ]):
|
for i in findChildren(dom, [ 'registry', 'feature' ]):
|
||||||
n = i.getAttribute('name')
|
n = i.getAttribute('name')
|
||||||
e = []
|
e = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'enum' ])]
|
||||||
c = []
|
c = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'command' ])]
|
||||||
for j in findChildren(i, [ 'require', 'enum' ]):
|
|
||||||
e.append(j.getAttribute("name"))
|
|
||||||
for j in findChildren(i, [ 'require', 'command' ]):
|
|
||||||
c.append(j.getAttribute("name"))
|
|
||||||
ret[n] = (e,c)
|
ret[n] = (e,c)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@ -75,12 +66,8 @@ def findExtensions(dom):
|
|||||||
ret = {}
|
ret = {}
|
||||||
for i in findChildren(dom, [ 'registry', 'extensions', 'extension' ]):
|
for i in findChildren(dom, [ 'registry', 'extensions', 'extension' ]):
|
||||||
n = i.getAttribute('name')
|
n = i.getAttribute('name')
|
||||||
e = []
|
e = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'enum' ])]
|
||||||
c = []
|
c = [j.getAttribute("name") for j in findChildren(i, [ 'require', 'command' ])]
|
||||||
for j in findChildren(i, [ 'require', 'enum' ]):
|
|
||||||
e.append(j.getAttribute("name"))
|
|
||||||
for j in findChildren(i, [ 'require', 'command' ]):
|
|
||||||
c.append(j.getAttribute("name"))
|
|
||||||
ret[n] = (e,c)
|
ret[n] = (e,c)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user