MCPcopy
hub / github.com/borgbackup/borg / format_line

Function format_line

src/borg/helpers/parseformat.py:351–360  ·  view source on GitHub ↗
(format, data)

Source from the content-addressed store, hash-verified

349
350
351def format_line(format, data):
352 for _, key, _, conversion in Formatter().parse(format):
353 if not key:
354 continue
355 if conversion or key not in data:
356 raise InvalidPlaceholder(key, format)
357 try:
358 return format.format_map(data)
359 except Exception as e:
360 raise PlaceholderError(format, data, e.__class__.__name__, str(e))
361
362
363def _replace_placeholders(text, overrides={}):

Callers 3

_replace_placeholdersFunction · 0.85
test_format_lineFunction · 0.85

Calls 3

InvalidPlaceholderClass · 0.85
PlaceholderErrorClass · 0.85
parseMethod · 0.45

Tested by 2

test_format_lineFunction · 0.68