Mercurial > libervia-backend
diff src/plugins/plugin_tmp_directory_subscription.py @ 2145:33c8c4973743
core (plugins): added missing contants + use of new constants in PLUGIN_INFO
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 12 Feb 2017 18:59:10 +0100 |
parents | 2daf7b4c6756 |
children |
line wrap: on
line diff
--- a/src/plugins/plugin_tmp_directory_subscription.py Sun Feb 12 17:55:43 2017 +0100 +++ b/src/plugins/plugin_tmp_directory_subscription.py Sun Feb 12 18:59:10 2017 +0100 @@ -19,20 +19,21 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from sat.core.i18n import _, D_ +from sat.core.constants import Const as C from sat.core.log import getLogger log = getLogger(__name__) PLUGIN_INFO = { - "name": "Directory subscription plugin", - "import_name": "DIRECTORY-SUBSCRIPTION", - "type": "TMP", - "protocols": [], - "dependencies": ["XEP-0050", "XEP-0055"], - "recommendations": [], - "main": "DirectorySubscription", - "handler": "no", - "description": _("""Implementation of directory subscription""") + C.PI_NAME: "Directory subscription plugin", + C.PI_IMPORT_NAME: "DIRECTORY-SUBSCRIPTION", + C.PI_TYPE: "TMP", + C.PI_PROTOCOLS: [], + C.PI_DEPENDENCIES: ["XEP-0050", "XEP-0055"], + C.PI_RECOMMENDATIONS: [], + C.PI_MAIN: "DirectorySubscription", + C.PI_HANDLER: "no", + C.PI_DESCRIPTION: _("""Implementation of directory subscription""") } @@ -55,7 +56,7 @@ @return: a deferred dict{unicode: unicode} """ d = self.host.plugins["XEP-0055"]._getHostServices(profile) - + def got_services(services): service_jid = services[0] session_id, session_data = self.host.plugins["XEP-0050"].requesting.newSession(profile=profile) @@ -63,5 +64,5 @@ session_data["node"] = CMD_UPDATE_SUBSCRIBTION data = {"session_id": session_id} return self.host.plugins["XEP-0050"]._requestingEntity(data, profile) - + return d.addCallback(got_services)