jp (profile): added disconnect command

This commit is contained in:
Goffi 2017-08-20 10:26:10 +02:00
commit eebf6e50e7

View file

@ -35,13 +35,26 @@ class ProfileConnect(base.CommandBase):
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 ProfileModify(base.CommandBase):
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'))