diff frontends/src/jp/cmd_info.py @ 2343:ca1ab42c7ae9

jp (info/disco): added --no-cache option
author Goffi <goffi@goffi.org>
date Tue, 22 Aug 2017 22:13:22 +0200
parents 4fd499d14b27
children c903c259402a
line wrap: on
line diff
--- a/frontends/src/jp/cmd_info.py	Tue Aug 22 22:12:57 2017 +0200
+++ b/frontends/src/jp/cmd_info.py	Tue Aug 22 22:13:22 2017 +0200
@@ -33,18 +33,19 @@
     def add_parser_options(self):
         self.parser.add_argument(u"jid", type=base.unicode_decoder, help=_(u"entity to discover"))
         self.parser.add_argument(u"-n", u"--node", type=base.unicode_decoder, default=u'', help=_(u"node to use"))
+        self.parser.add_argument(u"-C", u"--no-cache", dest='use_cache', action="store_false", help=_(u"ignore cache"))
 
     def start(self):
         jids = self.host.check_jids([self.args.jid])
         jid = jids[0]
-        self.host.bridge.discoInfos(jid, node=self.args.node, profile_key=self.host.profile, callback=lambda infos: self.gotInfos(infos, jid), errback=self.error)
+        self.host.bridge.discoInfos(jid, node=self.args.node, use_cache=self.args.use_cache, profile_key=self.host.profile, callback=lambda infos: self.gotInfos(infos, jid), errback=self.error)
 
     def error(self, failure):
         print (_("Error while doing discovery [%s]") % failure)
         self.host.quit(1)
 
     def gotInfos(self, infos, jid):
-        self.host.bridge.discoItems(jid, node=self.args.node, profile_key=self.host.profile, callback=lambda items: self.gotItems(infos, items), errback=self.error)
+        self.host.bridge.discoItems(jid, node=self.args.node, use_cache=self.args.use_cache, profile_key=self.host.profile, callback=lambda items: self.gotItems(infos, items), errback=self.error)
 
     def gotItems(self, infos, items):
         features, identities, extensions = infos