annotate frontends/src/jp/cmd_profile.py @ 1494:74ddb4cc2ff9

plugin XEP-0050: return disco for commands only on commands namespace
author Goffi <goffi@goffi.org>
date Tue, 25 Aug 2015 20:02:50 +0200
parents e4e960d285b0
children b7ee113183fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
815
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
1 #! /usr/bin/python
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
2 # -*- coding: utf-8 -*-
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
3
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
4 # jp: a SAT command line tool
1396
069ad98b360d 2015 copyright dates update
Goffi <goffi@goffi.org>
parents: 1199
diff changeset
5 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Jérôme Poisson (goffi@goffi.org)
815
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
6
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
7 # This program is free software: you can redistribute it and/or modify
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
10 # (at your option) any later version.
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
11
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
12 # This program is distributed in the hope that it will be useful,
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
15 # GNU Affero General Public License for more details.
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
16
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
f8d534ed1d1e jp: added missing license headers
Goffi <goffi@goffi.org>
parents: 814
diff changeset
19
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
20 """This module permits to manage profiles. It can list, create, delete
1199
96fb74a4714d misc: fixed some typos
Matteo Cypriani <mcy@lm7.fr>
parents: 1139
diff changeset
21 and retrieve information about a profile."""
0
goffi@necton2
parents:
diff changeset
22
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
23 from logging import debug, info, error, warning
771
bfabeedbf32e core: i18n refactoring:
Goffi <goffi@goffi.org>
parents: 721
diff changeset
24 from sat.core.i18n import _
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
25 from sat_frontends.jp import base
402
f03688bdb858 jp: use with statement to open fifo
Goffi <goffi@goffi.org>
parents: 401
diff changeset
26
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
27 __commands__ = ["Profile"]
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
28
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
29 PROFILE_HELP = _('The name of the profile')
0
goffi@necton2
parents:
diff changeset
30
goffi@necton2
parents:
diff changeset
31
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
32 class ProfileDelete(base.CommandBase):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
33 def __init__(self, host):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
34 super(ProfileDelete, self).__init__(host, 'delete', use_profile=False, help=_('Delete a profile'))
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
35
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
36 def add_parser_options(self):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
37 self.parser.add_argument('profile', type=str, help=PROFILE_HELP)
0
goffi@necton2
parents:
diff changeset
38
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
39 def run(self):
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
40 super(ProfileDelete, self).run()
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
41 if self.args.profile not in self.host.bridge.getProfilesList():
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
42 error("Profile %s doesn't exist." % self.args.profile)
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
43 self.host.quit(1)
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 817
diff changeset
44 self.host.bridge.asyncDeleteProfile(self.args.profile, callback=lambda dummy: None)
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
45
0
goffi@necton2
parents:
diff changeset
46
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
47 class ProfileInfo(base.CommandBase):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
48 def __init__(self, host):
1402
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
49 super(ProfileInfo, self).__init__(host, 'info', help=_('Get information about a profile'))
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
50 self.to_show = [(_(u"jid"), "Connection", "JabberID"),
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
51 (_(u"XMPP password"), "Connection", "Password"),
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
52 ]
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
53 self.largest = max([len(item[0]) for item in self.to_show])
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
54
0
goffi@necton2
parents:
diff changeset
55
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
56 def add_parser_options(self):
1402
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
57 pass
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
58
1402
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
59 def showNextValue(self, label=None, category=None, value=None):
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
60 """Show next value from self.to_show and quit on last one"""
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
61 if label is not None:
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
62 print((u"{label:<"+unicode(self.largest+2)+"}{value}").format(label=label+": ", value=value))
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
63 try:
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
64 label, category, name = self.to_show.pop(0)
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
65 except IndexError:
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
66 self.host.quit()
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
67 else:
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
68 self.host.bridge.asyncGetParamA(name, category, profile_key=self.host.profile,
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
69 callback=lambda value: self.showNextValue(label, category, value))
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
70
1402
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
71 def connected(self):
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
72 self.need_loop = True
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
73 super(ProfileInfo, self).connected()
391b0c21f4be jp (profile): fixed "profile info" to use profile, and then manage connection.
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
74 self.showNextValue()
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
75
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
76
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
77 class ProfileList(base.CommandBase):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
78 def __init__(self, host):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
79 super(ProfileList, self).__init__(host, 'list', use_profile=False, help=_('List profiles'))
657
09bbd5c00244 jp: profiles management
Dal <kedals0@gmail.com>
parents: 627
diff changeset
80
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
81 def add_parser_options(self):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
82 pass
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
83
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
84 def run(self):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
85 super(ProfileList, self).run()
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
86 for profile in self.host.bridge.getProfilesList():
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
87 print profile
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
88
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
89
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
90 class ProfileCreate(base.CommandBase):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
91 def __init__(self, host):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
92 super(ProfileCreate, self).__init__(host, 'create', use_profile=False, help=_('Create a new profile'))
657
09bbd5c00244 jp: profiles management
Dal <kedals0@gmail.com>
parents: 627
diff changeset
93
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
94 def add_parser_options(self):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
95 self.parser.add_argument('profile', type=str, help=_('the name of the profile'))
1403
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
96 self.parser.add_argument('-p', '--password', type=str, default='', help=_('the password of the profile'))
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
97 self.parser.add_argument('-j', '--jid', type=str, help=_('the jid of the profile'))
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
98 self.parser.add_argument('-x', '--xmpp-password', type=str, help=_('the password of the XMPP account (use profile password if not specified)'),
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
99 metavar='PASSWORD')
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
100
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
101 def _profile_created(self):
1403
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
102 if self.args.jid:
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
103 self.host.bridge.setParam("JabberID", self.args.jid, "Connection" ,profile_key=self.args.profile)
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
104 xmpp_pwd = self.args.password or self.args.xmpp_password
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
105 if xmpp_pwd:
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
106 self.host.bridge.setParam("Password", xmpp_pwd, "Connection", profile_key=self.args.profile)
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
107 self.host.quit()
657
09bbd5c00244 jp: profiles management
Dal <kedals0@gmail.com>
parents: 627
diff changeset
108
814
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
109 def run(self):
59c7bc51c323 jp: refactoring using ArgParse
Dal <kedals0@gmail.com>
parents: 811
diff changeset
110 """Create a new profile"""
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
111 self.need_loop = True
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
112 if self.args.profile in self.host.bridge.getProfilesList():
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
113 error("Profile %s already exists." % self.args.profile)
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
114 self.host.quit(1)
1403
f913b09cd9cc jp (profile): in "profile create", jid and password arguments are now optional + added a new --xmpp-password option to set XMPP password separately (default to the same password as for profile).
Goffi <goffi@goffi.org>
parents: 1402
diff changeset
115 self.host.bridge.asyncCreateProfile(self.args.profile, self.args.password, callback=self._profile_created, errback=None)
0
goffi@necton2
parents:
diff changeset
116
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
117
1404
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
118 class ProfileModify(base.CommandBase):
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
119 def __init__(self, host):
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
120 super(ProfileModify, self).__init__(host, 'modify', help=_('Modify an existing profile'))
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
121
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
122 def add_parser_options(self):
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
123 self.parser.add_argument('-w', '--password', type=str, default='', help=_('the password of the profile'))
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
124 self.parser.add_argument('-j', '--jid', type=str, help=_('the jid of the profile'))
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
125 self.parser.add_argument('-x', '--xmpp-password', type=str, help=_('the password of the XMPP account'),
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
126 metavar='PASSWORD')
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
127
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
128 def _profile_created(self):
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
129 if self.args.jid:
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
130 self.host.bridge.setParam("JabberID", self.args.jid, "Connection" ,profile_key=self.args.profile)
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
131 xmpp_pwd = self.args.password or self.args.xmpp_password
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
132 if xmpp_pwd:
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
133 self.host.bridge.setParam("Password", xmpp_pwd, "Connection", profile_key=self.args.profile)
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
134 self.host.quit()
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
135
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
136 def connected(self):
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
137 super(ProfileModify, self).connected()
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
138 if self.args.password is not None:
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
139 self.host.bridge.setParam("Password", self.args.password, "General", profile_key=self.host.profile)
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
140 if self.args.jid is not None:
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
141 self.host.bridge.setParam("JabberID", self.args.jid, "Connection", profile_key=self.host.profile)
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
142 if self.args.xmpp_password is not None:
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
143 self.host.bridge.setParam("Password", self.args.xmpp_password, "Connection", profile_key=self.host.profile)
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
144
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
145
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
146 class Profile(base.CommandBase):
1404
e4e960d285b0 jp (profile): added "profile modify" command
Goffi <goffi@goffi.org>
parents: 1403
diff changeset
147 subcommands = (ProfileDelete, ProfileInfo, ProfileList, ProfileCreate, ProfileModify)
817
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
148
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
149 def __init__(self, host):
c39117d00f35 jp: refactoring:
Goffi <goffi@goffi.org>
parents: 815
diff changeset
150 super(Profile, self).__init__(host, 'profile', use_profile=False, help=_('Profile commands'))