MCPcopy
hub / github.com/httpie/cli / Path

Class Path

httpie/cli/nested_json/tokens.py:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54
55class Path:
56 def __init__(
57 self,
58 kind: PathAction,
59 accessor: Optional[Union[str, int]] = None,
60 tokens: Optional[List[Token]] = None,
61 is_root: bool = False,
62 ):
63 self.kind = kind
64 self.accessor = accessor
65 self.tokens = tokens or []
66 self.is_root = is_root
67
68 def reconstruct(self) -> str:
69 if self.kind is PathAction.KEY:
70 if self.is_root:
71 return str(self.accessor)
72 return OPEN_BRACKET + self.accessor + CLOSE_BRACKET
73 elif self.kind is PathAction.INDEX:
74 return OPEN_BRACKET + str(self.accessor) + CLOSE_BRACKET
75 elif self.kind is PathAction.APPEND:
76 return OPEN_BRACKET + CLOSE_BRACKET
77
78
79class NestedJSONArray(list):

Callers 15

config.pyFile · 0.85
get_default_config_dirFunction · 0.85
__init__Method · 0.85
_configured_pathMethod · 0.85
as_siteFunction · 0.85
open_with_lockfileFunction · 0.85
__init__Method · 0.85
parse_rootFunction · 0.85
parseFunction · 0.85
interpretFunction · 0.85
_check_statusFunction · 0.85
_uninstallMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_daemon_runnerFunction · 0.68