plugin XEP-0085, quick_frontends, primitivus: chat states are working again

This commit is contained in:
Goffi 2016-07-17 16:47:33 +02:00
commit cc160e03d7

View file

@ -79,19 +79,22 @@ class QuickWidgetsManager(object):
raise exceptions.InternalError("There is not class registered for {}".format(class_))
return cls
def getWidgets(self, class_):
"""Get all subclassed widgets
def getWidgets(self, class_, profiles=None):
"""Get all subclassed widgets instances
@param class_: subclass of QuickWidget, same parameter as used in [getOrCreateWidget]
@param profiles(iterable, None): if not None, filter on instances linked to these profiles
@return: iterator on widgets
"""
class_ = self.getRealClass(class_)
try:
widgets_map = self._widgets[class_.__name__]
except KeyError:
return iter([])
return
else:
return widgets_map.itervalues()
for w in widgets_map.itervalues():
if profiles is None or w.profiles.intersection(profiles):
yield w
def getWidget(self, class_, target=None, profiles=None):
"""Get a widget without creating it if it doesn't exist.