jp: separate password and connection of profile in --connect and --pwd arguments
This commit is contained in:
parent
d0a2669051
commit
810a40c51c
1 changed files with 3 additions and 2 deletions
|
|
@ -111,7 +111,8 @@ class Jp(object):
|
|||
|
||||
profile_parent = self.parents['profile'] = argparse.ArgumentParser(add_help=False)
|
||||
profile_parent.add_argument("-p", "--profile", action="store", type=str, default='@DEFAULT@', help=_("Use PROFILE profile key (default: %(default)s)"))
|
||||
profile_parent.add_argument("-c", "--connect", action="store", type=str, nargs='?', const='', default=None, metavar='PASSWORD', help=_("Connect the profile before doing anything else"))
|
||||
profile_parent.add_argument("--pwd", action="store", type=unicode, default='', metavar='PASSWORD', help=_("Password used to connect profile, if necessary"))
|
||||
profile_parent.add_argument("-c", "--connect", action="store_true", help=_("Connect the profile before doing anything else"))
|
||||
|
||||
progress_parent = self.parents['progress'] = argparse.ArgumentParser(add_help=False)
|
||||
if progressbar:
|
||||
|
|
@ -243,7 +244,7 @@ class Jp(object):
|
|||
# a profile can be presente without connect option (e.g. on profile creation/deletion)
|
||||
return
|
||||
elif self.args.connect is not None: # if connection is asked, we connect the profile
|
||||
self.bridge.asyncConnect(self.profile, self.args.connect, lambda dummy: callback(), cant_connect)
|
||||
self.bridge.asyncConnect(self.profile, self.args.pwd, lambda dummy: callback(), cant_connect)
|
||||
self._auto_loop = True
|
||||
return
|
||||
elif not self.bridge.isConnected(self.profile):
|
||||
|
|
|
|||
Loading…
Reference in a new issue