Get the next available prefix. This means a prefix starting with 'ns' with a number appended as (ns0, ns1, ..) that is not already defined on the wsdl document.
(self)
| 156 | self.types.sort(key=lambda x: x[0].name) |
| 157 | |
| 158 | def nextprefix(self): |
| 159 | """ |
| 160 | Get the next available prefix. This means a prefix starting with 'ns' |
| 161 | with a number appended as (ns0, ns1, ..) that is not already defined |
| 162 | on the wsdl document. |
| 163 | """ |
| 164 | used = [ns[0] for ns in self.prefixes] |
| 165 | used += [ns[0] for ns in self.wsdl.root.nsprefixes.items()] |
| 166 | for n in range(0, 1024): |
| 167 | p = 'ns%d' % n |
| 168 | if p not in used: |
| 169 | return p |
| 170 | raise Exception('prefixes exhausted') |
| 171 | |
| 172 | def getprefix(self, u): |
| 173 | """ |