Mercurial > libervia-pubsub
view idavoll/disco.py @ 127:d3689da18ed2
Don't use encode('utf-8') on serialized XML.
Return unicode strings for get_items()
Rename get_items_by_ids() to get_items_by_id() as in the interface.
Make purge() work.
Don't return item ids when removing items.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Sun, 24 Apr 2005 17:21:43 +0000 |
parents | 6c0cc9c6caea |
children | ea8b4189ae3b |
line wrap: on
line source
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