1 from xml
.dom
import minidom
2 from zeroinstall
.injector
import namespaces
, model
5 """Find the single release marked as 'testing' and make it 'stable'."""
6 doc
= minidom
.parseString(data
)
8 all_impls
= doc
.documentElement
.getElementsByTagNameNS(namespaces
.XMLNS_IFACE
, 'implementation')
10 if get_stability(x
) == 'testing':
13 raise Exception('No implementations are currently "testing"!')
15 raise Exception("Multiple 'testing' implementations!")
17 testing
[0].setAttribute('stability', 'stable')
22 root
= x
.ownerDocument
.documentElement
24 stab
= x
.getAttribute('stability')
25 if stab
is not None: return stab