Example #1
0
 def document_actions(self, section):
     modeled_actions_list = self._resource_model.actions
     modeled_actions = {}
     for modeled_action in modeled_actions_list:
         modeled_actions[modeled_action.name] = modeled_action
     resource_actions = get_resource_public_actions(
         self._resource.__class__)
     self.member_map['actions'] = sorted(resource_actions)
     add_resource_type_overview(
         section=section,
         resource_type='Actions',
         description=(
             'Actions call operations on resources.  They may '
             'automatically handle the passing in of arguments set '
             'from identifiers and some attributes.'),
         intro_link='actions_intro')
     for action_name in sorted(resource_actions):
         action_section = section.add_new_section(action_name)
         if action_name in ['load', 'reload'] and self._resource_model.load:
             self._document_load_reload_action(action_section, action_name,
                                               self._resource_model.load)
         elif action_name in modeled_actions:
             self._document_modeled_action(action_section,
                                           modeled_actions[action_name])
         else:
             document_custom_method(section, action_name,
                                    resource_actions[action_name])
Example #2
0
 def document_actions(self, section):
     modeled_actions_list = self._resource_model.actions
     modeled_actions = {}
     for modeled_action in modeled_actions_list:
         modeled_actions[modeled_action.name] = modeled_action
     resource_actions = get_resource_public_actions(
         self._resource.__class__)
     self.member_map['actions'] = sorted(resource_actions)
     add_resource_type_overview(
         section=section,
         resource_type='Actions',
         description=(
             'Actions call operations on resources.  They may '
             'automatically handle the passing in of arguments set '
             'from identifiers and some attributes.'),
         intro_link='actions_intro')
     for action_name in sorted(resource_actions):
         action_section = section.add_new_section(action_name)
         if action_name in ['load', 'reload'] and self._resource_model.load:
             self._document_load_reload_action(
                 action_section, action_name, self._resource_model.load)
         elif action_name in modeled_actions:
             self._document_modeled_action(
                 action_section, modeled_actions[action_name])
         else:
             document_custom_method(
                 section, action_name, resource_actions[action_name])