69
|
1 from twisted.xish import domish |
|
2 |
|
3 NS = 'http://jabber.org/protocol/disco' |
|
4 NS_INFO = NS + '#info' |
|
5 NS_ITEMS = NS + '#items' |
|
6 |
|
7 class Feature(domish.Element): |
|
8 def __init__(self, feature): |
|
9 domish.Element.__init__(self, (NS_INFO, 'feature'), |
|
10 attribs={'var': feature}) |
|
11 class Identity(domish.Element): |
|
12 def __init__(self, category, type, name = None): |
|
13 domish.Element.__init__(self, (NS_INFO, 'identity'), |
|
14 attribs={'category': category, |
|
15 'type': type}) |
|
16 if name: |
|
17 self['name'] = name |
|
18 |
|
19 class Item(domish.Element): |
|
20 def __init__(self, jid, node = None, name = None): |
|
21 domish.Element.__init__(self, (NS_ITEMS, 'item'), |
|
22 attribs={'jid': jid}) |
|
23 if node: |
|
24 self['node'] = node |
|
25 |
|
26 if name: |
|
27 self['name'] = name |
|
28 |