MCPcopy Create free account
hub / github.com/aws/aws-cli / PrintOnlyHandler

Class PrintOnlyHandler

awscli/customizations/sso/utils.py:153–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153class PrintOnlyHandler(BaseAuthorizationhandler):
154 def __init__(self, outfile=None):
155 self._outfile = outfile
156
157 def __call__(
158 self, userCode, verificationUri, verificationUriComplete, **kwargs
159 ):
160 opening_msg = (
161 f'Browser will not be automatically opened.\n'
162 f'Please visit the following URL:\n'
163 f'\n{verificationUri}\n'
164 )
165
166 user_code_msg = (
167 f'\nThen enter the code:\n'
168 f'\n{userCode}\n'
169 f'\nAlternatively, you may visit the following URL which will '
170 f'autofill the code upon loading:'
171 f'\n{verificationUriComplete}\n'
172 )
173
174 uni_print(opening_msg, self._outfile)
175 if userCode:
176 uni_print(user_code_msg, self._outfile)
177
178
179class OpenBrowserHandler(BaseAuthorizationhandler):

Callers 4

test_prints_messageMethod · 0.90
_run_mainMethod · 0.90
_run_mainMethod · 0.90
_run_mainMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_prints_messageMethod · 0.72