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

Function validator

src/borg/helpers/parseformat.py:728–738  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

726
727def location_validator(proto=None, other=False):
728 def validator(text):
729 try:
730 loc = Location(text, other=other)
731 except ValueError as err:
732 raise ArgumentTypeError(str(err)) from None
733 if proto is not None and loc.proto != proto:
734 if proto == "file":
735 raise ArgumentTypeError('"%s": Repository must be local' % text)
736 else:
737 raise ArgumentTypeError('"%s": Repository must be remote' % text)
738 return loc
739
740 return validator
741

Callers

nothing calls this directly

Calls 1

LocationClass · 0.85

Tested by

no test coverage detected