def register_stanza_plugin(stanza, plugin, iterable=False, overrides=False):
 tag = (u'{%s}%s' % (plugin.namespace, plugin.name))
 plugin_info = (u'plugin_attrib_map', u'plugin_tag_map', u'plugin_iterables', u'plugin_overrides')
 for attr in plugin_info:
  info = getattr(stanza, attr)
  setattr(stanza, attr, info.copy())
 stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
 stanza.plugin_tag_map[tag] = plugin
 if iterable:
  stanza.plugin_iterables.add(plugin)
  if plugin.plugin_multi_attrib:
   multiplugin = multifactory(plugin, plugin.plugin_multi_attrib)
   register_stanza_plugin(stanza, multiplugin)
 if overrides:
  for interface in plugin.overrides:
   stanza.plugin_overrides[interface] = plugin.plugin_attrib

def register_stanza_plugin ( stanza , plugin , iterable = False , overrides = False ) : tag = ( u'{%s}%s' % ( plugin . namespace , plugin . name ) ) plugin_info = ( u'plugin_attrib_map' , u'plugin_tag_map' , u'plugin_iterables' , u'plugin_overrides' ) for attr in plugin_info : info = getattr ( stanza , attr ) setattr ( stanza , attr , info . copy ( ) ) stanza . plugin_attrib_map [ plugin . plugin_attrib ] = plugin stanza . plugin_tag_map [ tag ] = plugin if iterable : stanza . plugin_iterables . add ( plugin ) if plugin . plugin_multi_attrib : multiplugin = multifactory ( plugin , plugin . plugin_multi_attrib ) register_stanza_plugin ( stanza , multiplugin ) if overrides : for interface in plugin . overrides : stanza . plugin_overrides [ interface ] = plugin . plugin_attrib
associate a stanza object as a plugin for another stanza .