MCPcopy Index your code
hub / github.com/httpie/cli / SessionNameValidator

Class SessionNameValidator

httpie/cli/argtypes.py:28–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28class SessionNameValidator:
29
30 def __init__(self, error_message: str):
31 self.error_message = error_message
32
33 def __call__(self, value: str) -> str:
34 # Session name can be a path or just a name.
35 if (os.path.sep not in value
36 and not VALID_SESSION_NAME_PATTERN.search(value)):
37 raise argparse.ArgumentError(None, self.error_message)
38 return value
39
40
41class Escaped(str):

Callers 1

definition.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected