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

Function get_width

keepercommander/commands/base.py:514–525  ·  view source on GitHub ↗
(c_value)

Source from the content-addressed store, hash-verified

512 else:
513 # Calculate column widths
514 def get_width(c_value):
515 l = 0
516 if c_value:
517 if isinstance(c_value, str):
518 l = len(c_value)
519 elif isinstance(c_value, list):
520 l = max((len(str(x)) for x in c_value if x), default=0)
521 else:
522 l = len(str(c_value))
523 if l > 50:
524 l = 50
525 return l
526
527 if headers:
528 widths = [max(len(x), 10) if x else 0 for x in headers]

Callers 1

dump_report_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected