diff --git a/frontends/src/jp/cmd_profile.py b/frontends/src/jp/cmd_profile.py index a33e57b6..68a014b5 100644 --- a/frontends/src/jp/cmd_profile.py +++ b/frontends/src/jp/cmd_profile.py @@ -143,22 +143,18 @@ class ProfileModify(base.CommandBase): super(ProfileModify, self).__init__(host, 'modify', need_connect=False, help=_('modify an existing profile')) def add_parser_options(self): - self.parser.add_argument('-w', '--password', type=str, default='', help=_('the password of the profile')) - self.parser.add_argument('-j', '--jid', type=str, help=_('the jid of the profile')) - self.parser.add_argument('-x', '--xmpp-password', type=str, help=_('the password of the XMPP account'), + profile_pwd_group = self.parser.add_mutually_exclusive_group() + profile_pwd_group.add_argument('-w', '--password', type=base.unicode_decoder, help=_('change the password of the profile')) + profile_pwd_group.add_argument('--disable-password', action='store_true', help=_('disable profile password (dangerous!)')) + self.parser.add_argument('-j', '--jid', type=base.unicode_decoder, help=_('the jid of the profile')) + self.parser.add_argument('-x', '--xmpp-password', type=base.unicode_decoder, help=_('change the password of the XMPP account'), metavar='PASSWORD') self.parser.add_argument('-D', '--default', action='store_true', help=_(u'set as default profile')) - def _profile_created(self): - if self.args.jid: - self.host.bridge.setParam("JabberID", self.args.jid, "Connection" ,profile_key=self.args.profile) - xmpp_pwd = self.args.password or self.args.xmpp_password - if xmpp_pwd: - self.host.bridge.setParam("Password", xmpp_pwd, "Connection", profile_key=self.args.profile) - self.host.quit() - def connected(self): super(ProfileModify, self).connected() + if self.args.disable_password: + self.args.password = '' if self.args.password is not None: self.host.bridge.setParam("Password", self.args.password, "General", profile_key=self.host.profile) if self.args.jid is not None: