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

Function get_width

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

Source from the content-addressed store, hash-verified

508 else:
509 # Calculate column widths
510 def get_width(c_value):
511 l = 0
512 if c_value:
513 if isinstance(c_value, str):
514 l = len(c_value)
515 elif isinstance(c_value, list):
516 l = max((len(str(x)) for x in c_value if x), default=0)
517 else:
518 l = len(str(c_value))
519 if l > 50:
520 l = 50
521 return l
522
523 if headers:
524 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