# HG changeset patch # User Goffi # Date 1503217570 -7200 # Node ID a7438fe4e24df7c0116e75b9e5b11c69b34c4b6b # Parent b226f545f67e75928251fcb9b977b2d3a894c22c jp (profile): added disconnect command diff -r b226f545f67e -r a7438fe4e24d frontends/src/jp/cmd_profile.py --- a/frontends/src/jp/cmd_profile.py Mon Jul 17 16:20:55 2017 +0200 +++ b/frontends/src/jp/cmd_profile.py Sun Aug 20 10:26:10 2017 +0200 @@ -35,13 +35,26 @@ def __init__(self, host): # it's weird to have a command named "connect" with need_connect=False, but it can be handy to be able - # to launch just the session, so some paradox don't hurt + # to launch just the session, so some paradoxes don't hurt super(ProfileConnect, self).__init__(host, 'connect', need_connect=False, help=(u'connect a profile')) def add_parser_options(self): pass +class ProfileDisconnect(base.CommandBase): + + def __init__(self, host): + super(ProfileDisconnect, self).__init__(host, 'disconnect', need_connect=False, help=(u'disconnect a profile')) + self.need_loop = True + + def add_parser_options(self): + pass + + def start(self): + self.host.bridge.disconnect(self.args.profile, callback=self.host.quit) + + class ProfileDefault(base.CommandBase): def __init__(self, host): super(ProfileDefault, self).__init__(host, 'default', use_profile=False, help=(u'print default profile')) @@ -184,7 +197,7 @@ class Profile(base.CommandBase): - subcommands = (ProfileConnect, ProfileCreate, ProfileDefault, ProfileDelete, ProfileInfo, ProfileList, ProfileModify) + subcommands = (ProfileConnect, ProfileDisconnect, ProfileCreate, ProfileDefault, ProfileDelete, ProfileInfo, ProfileList, ProfileModify) def __init__(self, host): super(Profile, self).__init__(host, 'profile', use_profile=False, help=_(u'profile commands'))