diff frontends/src/jp/cmd_info.py @ 1864:96ba685162f6

jp: all commands now use the new start method and set need_loop in __init__ when needed
author Goffi <goffi@goffi.org>
date Mon, 29 Feb 2016 16:52:51 +0100
parents d17772b0fe22
children 3e168cde7a7d
line wrap: on
line diff
--- a/frontends/src/jp/cmd_info.py	Mon Feb 29 16:52:51 2016 +0100
+++ b/frontends/src/jp/cmd_info.py	Mon Feb 29 16:52:51 2016 +0100
@@ -17,8 +17,6 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from logging import debug, info, warning
-
 import base
 from sat.core.i18n import _
 
@@ -29,13 +27,12 @@
 
     def __init__(self, host):
         super(Disco, self).__init__(host, 'disco', help=_('Service discovery'))
+        self.need_loop=True
 
     def add_parser_options(self):
         self.parser.add_argument("jid", type=str, help=_("Entity to discover"))
 
-    def connected(self):
-        self.need_loop=True
-        super(Disco, self).connected()
+    def start(self):
         jids = self.host.check_jids([self.args.jid])
         jid = jids[0]
         self.host.bridge.discoInfos(jid, profile_key=self.host.profile, callback=lambda infos: self.gotInfos(infos, jid), errback=self.error)
@@ -108,13 +105,12 @@
 
     def __init__(self, host):
         super(Version, self).__init__(host, 'version', help=_('Client version'))
+        self.need_loop=True
 
     def add_parser_options(self):
         self.parser.add_argument("jid", type=str, help=_("Entity to request"))
 
-    def connected(self):
-        self.need_loop=True
-        super(Version, self).connected()
+    def start(self):
         jids = self.host.check_jids([self.args.jid])
         jid = jids[0]
         self.host.bridge.getSoftwareVersion(jid, self.host.profile, callback=self.gotVersion, errback=self.error)