Mercurial > libervia-pubsub
annotate idavoll/disco.py @ 160:d183e48a5049
update tags
author | convert-repo |
---|---|
date | Thu, 18 Jun 2009 11:52:06 +0000 |
parents | 5191ba7c4df8 |
children |
rev | line source |
---|---|
155
5191ba7c4df8
Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
152
diff
changeset
|
1 # Copyright (c) 2003-2006 Ralph Meijer |
5191ba7c4df8
Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
152
diff
changeset
|
2 # See LICENSE for details. |
5191ba7c4df8
Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
152
diff
changeset
|
3 |
152 | 4 from twisted.words.xish import domish |
69 | 5 |
6 NS = 'http://jabber.org/protocol/disco' | |
7 NS_INFO = NS + '#info' | |
8 NS_ITEMS = NS + '#items' | |
9 | |
10 class Feature(domish.Element): | |
11 def __init__(self, feature): | |
12 domish.Element.__init__(self, (NS_INFO, 'feature'), | |
13 attribs={'var': feature}) | |
14 class Identity(domish.Element): | |
15 def __init__(self, category, type, name = None): | |
16 domish.Element.__init__(self, (NS_INFO, 'identity'), | |
17 attribs={'category': category, | |
18 'type': type}) | |
19 if name: | |
20 self['name'] = name | |
21 | |
22 class Item(domish.Element): | |
23 def __init__(self, jid, node = None, name = None): | |
24 domish.Element.__init__(self, (NS_ITEMS, 'item'), | |
25 attribs={'jid': jid}) | |
26 if node: | |
27 self['node'] = node | |
28 | |
29 if name: | |
30 self['name'] = name | |
31 |