jp: added profile/connect command

This commit is contained in:
Goffi 2015-11-14 19:19:04 +01:00
commit 4826320188

View file

@ -29,6 +29,18 @@ __commands__ = ["Profile"]
PROFILE_HELP = _('The name of the profile')
class ProfileConnect(base.CommandBase):
"""Dummy command to use profile_session parent, i.e. to be able to connect without doing anything else"""
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
super(ProfileConnect, self).__init__(host, 'connect', need_connect=False, help=_('connect a profile'))
def add_parser_options(self):
pass
class ProfileDefault(base.CommandBase):
def __init__(self, host):
super(ProfileDefault, self).__init__(host, 'default', use_profile=False, help=_('print default profile'))
@ -100,7 +112,7 @@ class ProfileList(base.CommandBase):
class ProfileCreate(base.CommandBase):
def __init__(self, host):
super(ProfileCreate, self).__init__(host, 'create', use_profile=False, help=_('Create a new profile'))
super(ProfileCreate, self).__init__(host, 'create', use_profile=False, help=_('create a new profile'))
def add_parser_options(self):
self.parser.add_argument('profile', type=str, help=_('the name of the profile'))
@ -128,7 +140,7 @@ class ProfileCreate(base.CommandBase):
class ProfileModify(base.CommandBase):
def __init__(self, host):
super(ProfileModify, self).__init__(host, 'modify', need_connect=False, help=_('Modify an existing profile'))
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'))
@ -158,7 +170,7 @@ class ProfileModify(base.CommandBase):
class Profile(base.CommandBase):
subcommands = (ProfileCreate, ProfileDefault, ProfileDelete, ProfileInfo, ProfileList, ProfileModify)
subcommands = (ProfileConnect, ProfileCreate, ProfileDefault, ProfileDelete, ProfileInfo, ProfileList, ProfileModify)
def __init__(self, host):
super(Profile, self).__init__(host, 'profile', use_profile=False, help=_('Profile commands'))