annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #! /usr/bin/python
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
3
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # jp: a SAT command line tool
1766
d17772b0fe22 copyright update
Goffi <goffi@goffi.org>
parents: 1414
diff changeset
5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org)
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
6
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # (at your option) any later version.
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
11
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
16
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
19
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
20 import base
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
21 from sat.core.i18n import _
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
22
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
23 __commands__ = ["Info"]
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
24
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
25
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
26 class Disco(base.CommandBase):
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
27
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
28 def __init__(self, host):
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
29 super(Disco, self).__init__(host, 'disco', help=_('Service discovery'))
1864
96ba685162f6 jp: all commands now use the new start method and set need_loop in __init__ when needed
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
30 self.need_loop=True
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
31
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
32 def add_parser_options(self):
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
33 self.parser.add_argument("jid", type=str, help=_("Entity to discover"))
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
34
1864
96ba685162f6 jp: all commands now use the new start method and set need_loop in __init__ when needed
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
35 def start(self):
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
36 jids = self.host.check_jids([self.args.jid])
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
37 jid = jids[0]
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
38 self.host.bridge.discoInfos(jid, profile_key=self.host.profile, callback=lambda infos: self.gotInfos(infos, jid), errback=self.error)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
39
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
40 def error(self, failure):
1063
6ec513ad92c2 frontends: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 974
diff changeset
41 print (_("Error while doing discovery [%s]") % failure)
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
42 self.host.quit(1)
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
43
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
44 def gotInfos(self, infos, jid):
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
45 self.host.bridge.discoItems(jid, profile_key=self.host.profile, callback=lambda items: self.gotItems(infos, items), errback=self.error)
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
46
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
47 def gotItems(self, infos, items):
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
48 features, identities, extensions = infos
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
49 features.sort()
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
50 identities.sort(key=lambda identity: identity[2])
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
51 items.sort(key=lambda item: item[2])
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
52 identities_lst = []
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
53 items_lst = []
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
54 for identity in identities:
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
55 category, type_, name = identity
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
56 identities_lst.append(u"{name}({cat}/{type_})".format(
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
57 name = (name+' ') if name else '',
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
58 cat = category,
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
59 type_ = type_))
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
60 for item in items:
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
61 entity, node_id, name = item
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
62 items_lst.append(u"{name}[{entity}{node_id}]".format(
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
63 name = (name+' ') if name else '',
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
64 entity = entity,
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
65 node_id = (', ' + node_id) if node_id else ''
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
66 ))
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
67 extensions_types = extensions.keys()
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
68 extensions_types.sort()
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
69
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
70 extensions_tpl = []
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
71 for type_ in extensions_types:
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
72 fields = []
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
73 for field in extensions[type_]:
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
74 field_lines = []
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
75 data, values = field
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
76 data_keys = data.keys()
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
77 data_keys.sort()
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
78 for key in data_keys:
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
79 field_lines.append(u'\t{key} = {value}'.format(key=key, value=data[key]))
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
80 for value in values:
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
81 field_lines.append(u'\tvalue = {value}'.format(value=value))
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
82 fields.append(u'\n'.join(field_lines))
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
83 extensions_tpl.append(u'{type_}\n{fields}'.format(type_=type_,
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
84 fields='\n\n'.join(fields)))
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
85
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
86 template = []
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
87 if features:
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
88 template.append(_(u"Features:\n\n{features}"))
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
89 if identities:
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
90 template.append(_(u"Identities:\n\n{identities}"))
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
91 if extensions_tpl:
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
92 template.append(_(u'Extensions:\n\n{extensions}'))
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
93 if items:
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
94 template.append(_(u"Items:\n\n{items}"))
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
95
1414
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
96 print "\n--\n".join(template).format ( features = '\n'.join(features),
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
97 identities = '\n'.join(identities_lst),
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
98 extensions = '\n'.join(extensions_tpl),
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
99 items = '\n'.join(items_lst),
159d16336f87 core, bridge, jp: management of service discovery extensions (XEP-0128)
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
100 )
966
9cae72da1b95 jp: added disco subcommand
Goffi <goffi@goffi.org>
parents:
diff changeset
101 self.host.quit()
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
102
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
103
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
104 class Version(base.CommandBase):
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
105
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
106 def __init__(self, host):
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
107 super(Version, self).__init__(host, 'version', help=_('Client version'))
1864
96ba685162f6 jp: all commands now use the new start method and set need_loop in __init__ when needed
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
108 self.need_loop=True
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
109
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
110 def add_parser_options(self):
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
111 self.parser.add_argument("jid", type=str, help=_("Entity to request"))
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
112
1864
96ba685162f6 jp: all commands now use the new start method and set need_loop in __init__ when needed
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
113 def start(self):
971
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
114 jids = self.host.check_jids([self.args.jid])
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
115 jid = jids[0]
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
116 self.host.bridge.getSoftwareVersion(jid, self.host.profile, callback=self.gotVersion, errback=self.error)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
117
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
118 def error(self, failure):
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
119 print (_("Error while trying to get version [%s]") % failure)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
120 self.host.quit(1)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
121
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
122 def gotVersion(self, data):
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
123 infos = []
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
124 name, version, os = data
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
125 if name:
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
126 infos.append(_("Client name: %s") % name)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
127 if version:
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
128 infos.append(_("Client version: %s") % version)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
129 if os:
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
130 infos.append(_("Operating System: %s") % os)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
131
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
132 print "\n".join(infos)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
133 self.host.quit()
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
134
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
135
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
136 class Info(base.CommandBase):
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
137 subcommands = (Disco, Version)
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
138
8ca5c990ed92 jp: "disco" subcommand, moved into a new "info" subcommand + added "version" subcommand which get software version
Goffi <goffi@goffi.org>
parents: 966
diff changeset
139 def __init__(self, host):
1199
96fb74a4714d misc: fixed some typos
Matteo Cypriani <mcy@lm7.fr>
parents: 1063
diff changeset
140 super(Info, self).__init__(host, 'info', use_profile=False, help=_('Get various pieces of information on entities'))