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

Method format_content

src/borg/helpers/parseformat.py:1220–1234  ·  view source on GitHub ↗
(self, diff: "ItemDiff")

Source from the content-addressed store, hash-verified

1218 return ""
1219
1220 def format_content(self, diff: "ItemDiff"):
1221 change = diff.content()
1222 if change:
1223 if change.diff_type == "added":
1224 return "{}: {:>20}".format(change.diff_type, format_file_size(change.diff_data["added"]))
1225 if change.diff_type == "removed":
1226 return "{}: {:>18}".format(change.diff_type, format_file_size(change.diff_data["removed"]))
1227 if "added" not in change.diff_data and "removed" not in change.diff_data:
1228 return "modified: (can't get size)"
1229 return "{}: {:>8} {:>8}".format(
1230 change.diff_type,
1231 format_file_size(change.diff_data["added"], precision=1, sign=True),
1232 format_file_size(-change.diff_data["removed"], precision=1, sign=True),
1233 )
1234 return ""
1235
1236 def format_time(self, key, diff: "ItemDiff"):
1237 change = diff.changes().get(key)

Callers

nothing calls this directly

Calls 2

format_file_sizeFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected