MCPcopy Index your code
hub / github.com/aws/aws-cli / AliasCommandInjector

Class AliasCommandInjector

awscli/alias.py:114–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114class AliasCommandInjector(BaseAliasCommandInjector):
115 def __init__(self, session, alias_loader):
116 """Injects alias commands for a command table
117
118 :type session: botocore.session.Session
119 :param session: The botocore session
120
121 :type alias_loader: awscli.alias.AliasLoader
122 :param alias_loader: The alias loader to use
123 """
124 super(AliasCommandInjector, self).__init__(alias_loader)
125 self._session = session
126
127 def inject_aliases(self, command_table, parser):
128 for alias_name, alias_value in self._get_alias_items():
129 if self._is_external_alias(alias_value):
130 self._inject_external_alias(
131 alias_name, alias_value, command_table
132 )
133 else:
134 service_alias_cmd_args = [
135 alias_name,
136 alias_value,
137 self._session,
138 command_table,
139 parser,
140 ]
141 # If the alias name matches something already in the
142 # command table provide the command it is about
143 # to clobber as a possible reference that it will
144 # need to proxy to.
145 if alias_name in command_table:
146 service_alias_cmd_args.append(command_table[alias_name])
147 alias_cmd = ServiceAliasCommand(*service_alias_cmd_args)
148 command_table[alias_name] = alias_cmd
149
150
151class AliasSubCommandInjector(BaseAliasCommandInjector):

Callers 2

setUpMethod · 0.90
_add_aliasesMethod · 0.90

Calls

no outgoing calls

Tested by 1

setUpMethod · 0.72