# HG changeset patch # User Ralph Meijer # Date 1099836997 0 # Node ID 6c0cc9c6caea15c930551073adede5512bb28819 # Parent a3d67cbab9c4ca26436f48c4ec5cd4b22f3d4dd9 Initial revision diff -r a3d67cbab9c4 -r 6c0cc9c6caea idavoll/disco.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idavoll/disco.py Sun Nov 07 14:16:37 2004 +0000 @@ -0,0 +1,28 @@ +from twisted.xish import domish + +NS = 'http://jabber.org/protocol/disco' +NS_INFO = NS + '#info' +NS_ITEMS = NS + '#items' + +class Feature(domish.Element): + def __init__(self, feature): + domish.Element.__init__(self, (NS_INFO, 'feature'), + attribs={'var': feature}) +class Identity(domish.Element): + def __init__(self, category, type, name = None): + domish.Element.__init__(self, (NS_INFO, 'identity'), + attribs={'category': category, + 'type': type}) + if name: + self['name'] = name + +class Item(domish.Element): + def __init__(self, jid, node = None, name = None): + domish.Element.__init__(self, (NS_ITEMS, 'item'), + attribs={'jid': jid}) + if node: + self['node'] = node + + if name: + self['name'] = name +