Mercurial > libervia-backend
changeset 1650:b08b828a87c9
quick frontend (blog): fixed group blog panels (displaying only, sending is not working yet)
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 23 Nov 2015 16:21:32 +0100 |
parents | b58c8b4715c6 |
children | 5c1d6efd6936 |
files | frontends/src/quick_frontend/quick_blog.py src/core/sat_main.py |
diffstat | 2 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_blog.py Mon Nov 23 15:51:19 2015 +0100 +++ b/frontends/src/quick_frontend/quick_blog.py Mon Nov 23 16:21:32 2015 +0100 @@ -375,10 +375,13 @@ def gotSession(rt_session): self._getResults(rt_session) - if self._targets_type == C.ALL: - self.host.bridge.mbGetFromManyWithComments(C.ALL, (), 10, 10, {}, {"subscribe":C.BOOL_TRUE}, profile=self.profile, callback=gotSession) + if self._targets_type in (C.ALL, C.GROUP): + targets = tuple(self.targets) if self._targets_type is C.GROUP else () + self.host.bridge.mbGetFromManyWithComments(self._targets_type, targets, 10, 10, {}, {"subscribe":C.BOOL_TRUE}, profile=self.profile, callback=gotSession) own_pep = self.host.whoami.bare self.host.bridge.mbGetFromManyWithComments(C.JID, (unicode(own_pep),), 10, 10, {}, {}, profile=self.profile, callback=gotSession) + else: + raise NotImplementedError(u'{} target type is not managed'.format(self._targets_type)) def isJidAccepted(self, jid_): """Tell if a jid is actepted and must be shown in this panel @@ -458,15 +461,15 @@ def mbdata2tags(mb_data): """Parse the tags in microblog data. - + @param mb_data (dict): microblog data as return by bridge methods @return list[unicode] """ return [tag for key, tag in mb_data.iteritems() if (key == "tag" or key.startswith("tag#")) and tag] - + def tags2mbdata(tags): """Build from the tags a dict using the microblog data format. - + @param tags (list[unicode]): list of tags @return dict """
--- a/src/core/sat_main.py Mon Nov 23 15:51:19 2015 +0100 +++ b/src/core/sat_main.py Mon Nov 23 16:21:32 2015 +0100 @@ -364,7 +364,7 @@ C.PROF_KEY_NONE can be used to have general plugins data (i.e. not profile dependent) @return (dict)[Deferred]: features data where: - key is plugin import name, present only for activated plugins - - value is a an other dict, when meaning is specifif to each plugin. + - value is a an other dict, when meaning is specific to each plugin. this dict is return by plugin's getFeature method. If this method doesn't exists, an empty dict is returned. """