MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / display_code

Method display_code

keepercommander/commands/record_totp.py:161–171  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

159
160 @staticmethod
161 def display_code(url):
162 code, remains, total = get_totp_code(url)
163 progress = ''.rjust(remains, '=')
164 progress = progress.ljust(total, ' ')
165 if os.isatty(0):
166 print('\r', file=sys.stderr, end='', flush=True)
167 print('\t{0}\t\t[{1}]'.format(code, progress), file=sys.stderr, end='', flush=True)
168 else:
169 if TotpCommand.LastDisplayedCode != code:
170 print('\t{0}\t\tvalid for {1} seconds.'.format(code, remains))
171 TotpCommand.LastDisplayedCode = code
172
173 @staticmethod
174 def find_endpoints(params):

Callers 1

print_codeMethod · 0.80

Calls 2

get_totp_codeFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected