def get_help_strings(cls):
        """ Help strings for consent commands. """
        group, cmd, args = get_help_strings()

        group.setdefault('consent', 'Commands for handling consents')

        cmd.setdefault('consent', dict()).update({
            'consent_set':
            cls.consent_set.__doc__,
            'consent_unset':
            cls.consent_unset.__doc__,
            'consent_info':
            cls.consent_info.__doc__,
            'consent_list':
            cls.consent_list.__doc__,
        })

        args.update({
            'consent_type': [
                'type', 'Enter consent type',
                "'consent list' lists defined consents"
            ],
        })

        return (group, cmd, args)
Example #2
0
    def get_help_strings(cls):
        """Get help strings."""
        # look up types
        co = Factory.get('Constants')()
        source_systems = co.fetch_constants(co.AuthoritativeSystem)
        contact_types = co.fetch_constants(co.ContactInfo)

        # Enrich cmd_args with actual constants.
        # TODO: Find a better way to do this for all similar cmd_args
        cmd_args = {}
        list_sep = '\n - '
        for k, v in CMD_ARGS.items():
            cmd_args[k] = v[:]
            if k == 'entity_contact_source_system':
                cmd_args[k][2] += '\nSource systems:'
                cmd_args[k][2] += list_sep + list_sep.join(six.text_type(c) for
                                                           c in source_systems)
            if k == 'entity_contact_type':
                cmd_args[k][2] += '\nContact types:'
                cmd_args[k][2] += list_sep + list_sep.join(six.text_type(c) for
                                                           c in contact_types)
        del co

        return merge_help_strings(
            ({}, {}, cmd_args),  # We want _our_ cmd_args to win!
            get_help_strings(),
            ({}, CMD_HELP, {}))
Example #3
0
    def get_help_strings(cls):
        """Get help strings."""
        group_help = {
            'history': "History related commands",
        }

        command_help = {
            'history': {
                'history_show': 'List changes made to an entity',
            }
        }

        argument_help = {
            'limit_number_of_results': [
                'limit', 'Number of changes to list',
                'Upper limit for how many changes to include, counting '
                'backwards from the most recent. Default (when left empty) '
                'is 0, which means no limit'
            ],
            'yes_no_all_changes': [
                'all', 'All involved changes?',
                'List all changes where the entity is involved (yes), or '
                'only the ones where the entity itself is changed (no)'
            ],
        }

        return merge_help_strings(
            get_help_strings(),
            (group_help, command_help, argument_help),
        )
    def get_help_strings(cls):
        """Get help strings."""
        # look up types
        co = Factory.get('Constants')()
        source_systems = co.fetch_constants(co.AuthoritativeSystem)
        contact_types = co.fetch_constants(co.ContactInfo)

        # Enrich cmd_args with actual constants.
        # TODO: Find a better way to do this for all similar cmd_args
        cmd_args = {}
        list_sep = '\n - '
        for k, v in CMD_ARGS.items():
            cmd_args[k] = v[:]
            if k == 'entity_contact_source_system':
                cmd_args[k][2] += '\nSource systems:'
                cmd_args[k][2] += list_sep + list_sep.join(six.text_type(c) for
                                                           c in source_systems)
            if k == 'entity_contact_type':
                cmd_args[k][2] += '\nContact types:'
                cmd_args[k][2] += list_sep + list_sep.join(six.text_type(c) for
                                                           c in contact_types)
        del co

        return merge_help_strings(
            ({}, {}, cmd_args),  # We want _our_ cmd_args to win!
            get_help_strings(),
            ({}, CMD_HELP, {}))
Example #5
0
 def get_help_strings(cls):
     const = Factory.get('Constants')()
     account_types = const.fetch_constants(const.Account)
     cmd_args = {}
     list_sep = '\n - '
     for key, value in CMD_ARGS.items():
         cmd_args[key] = value[:]
         if key == 'unpersonal_account_type':
             cmd_args[key][2] += '\nValid account types:'
             cmd_args[key][2] += list_sep + list_sep.join(
                 six.text_type(c) for c in account_types)
     del const
     return merge_help_strings(
         ({}, {}, cmd_args),  # We want _our_ cmd_args to win!
         get_help_strings(),
         ({}, CMD_HELP, {}))
Example #6
0
 def get_help_strings(cls):
     cmds = {
         'misc': {
             'misc_list_legacy_user': '******',
         },
         'user': {
             'user_delete_permanent': 'Delete an account permanently',
         },
     }
     args = {
         'yes_no_sure': [
             'certain',
             'Are you absolutely certain you want to do this? This deletes'
             ' the account completely from the database and can not be'
             ' reversed. (y/n)'
         ]
     }
     return merge_help_strings(bofhd_core_help.get_help_strings(),
                               ({}, cmds, args))
Example #7
0
    def get_help_strings(cls):
        """ Help strings for consent commands. """
        group, cmd, args = get_help_strings()

        group.setdefault('consent', 'Commands for handling consents')

        cmd.setdefault('consent', dict()).update({
            'consent_set': cls.consent_set.__doc__,
            'consent_unset': cls.consent_unset.__doc__,
            'consent_info': cls.consent_info.__doc__,
            'consent_list': cls.consent_list.__doc__,
        })

        args.update({
            'consent_type': ['type', 'Enter consent type',
                             "'consent list' lists defined consents"],
        })

        return (group, cmd, args)
Example #8
0
 def get_help_strings(cls):
     return bofhd_core_help.get_help_strings()
 def get_help_strings(cls):
     return merge_help_strings(get_help_strings(), ({}, HELP_CMDS, {}))
Example #10
0
 def get_help_strings(cls):
     return merge_help_strings(get_help_strings(),
                               ({}, HELP_CMDS, {}))
 def get_help_strings(cls):
     """Get help strings."""
     return merge_help_strings(
         (HELP_GROUP, HELP_CMD, HELP_ARGS),
         get_help_strings())
Example #12
0
 def get_help_strings(cls):
     return bofhd_core_help.get_help_strings()
 def get_help_strings(cls):
     group, _, args = get_help_strings()
     # merge help strings will strip away unused groups
     return merge_help_strings((group, {}, args), ({}, CMD_HELP, {}))
Example #14
0
 def get_help_strings(cls):
     """Definition of the help text for event-related commands."""
     _, _, args = get_help_strings()
     return merge_help_strings(
         ({}, {}, args),
         (HELP_EVENT_GROUP, HELP_EVENT_CMDS, HELP_EVENT_ARGS))
 def get_help_strings(cls):
     _, _, args = get_help_strings()
     return merge_help_strings(
         ({}, {}, args),
         (HELP_SUBNET_GROUP, HELP_SUBNET_CMDS, HELP_SUBNET_ARGS))
Example #16
0
 def get_help_strings(cls):
     group, _, args = get_help_strings()
     # merge help strings will strip away unused groups
     return merge_help_strings(
         (group, {}, args),
         ({}, CMD_HELP, {}))