mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1198228 - Support em:foo attributes on Description elements. r=whimboo
The install.rdf in language packs uses em:id attributes etc, instead of child elements. All fine with RDF/XML. This adds support to addon_details to allow for those attributes in addition to child elements.
This commit is contained in:
parent
c36ec9adc7
commit
d9e570bdaf
@ -297,6 +297,11 @@ class AddonManager(object):
|
||||
rdf = get_namespace_id(doc, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
|
||||
|
||||
description = doc.getElementsByTagName(rdf + 'Description').item(0)
|
||||
for entry, value in description.attributes.items():
|
||||
# Remove the namespace prefix from the tag for comparison
|
||||
entry = entry.replace(em, "")
|
||||
if entry in details.keys():
|
||||
details.update({entry: value})
|
||||
for node in description.childNodes:
|
||||
# Remove the namespace prefix from the tag for comparison
|
||||
entry = node.nodeName.replace(em, "")
|
||||
|
@ -148,7 +148,32 @@ class AddonIDTest(unittest.TestCase):
|
||||
<foobar:description>A testing extension based on the Windmill Testing Framework client source</foobar:description>
|
||||
<foobar:unpack>true</foobar:unpack>
|
||||
</Description>
|
||||
</RDF>"""]
|
||||
</RDF>""",
|
||||
"""<?xml version="1.0"?>
|
||||
<!--
|
||||
|
||||
-->
|
||||
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest"
|
||||
em:id="winning"
|
||||
em:name="Language Pack"
|
||||
em:version="42.0a2"
|
||||
em:type="8"
|
||||
em:creator="Some Contributor">
|
||||
<em:contributor></em:contributor>
|
||||
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>42.0a2</em:minVersion>
|
||||
<em:maxVersion>42.0a2</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
</RDF>
|
||||
"""]
|
||||
return tests
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user