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

Function format_two_factor_duration

keepercommander/constants.py:286–292  ·  view source on GitHub ↗

Convert stored cumulative value like '0,12,24,30' to the effective setting like '30_days'.

(raw_value)

Source from the content-addressed store, hash-verified

284
285
286def format_two_factor_duration(raw_value): # type: (str) -> str
287 """Convert stored cumulative value like '0,12,24,30' to the effective setting like '30_days'."""
288 if not isinstance(raw_value, str):
289 raw_value = str(raw_value) if raw_value is not None else ''
290 tokens = [x.strip() for x in raw_value.split(',')]
291 last = tokens[-1] if tokens else ''
292 return TWO_FACTOR_DURATION_MAP.get(last, last)
293
294
295week_days = ('SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY')

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected