MCPcopy Create free account
hub / github.com/dot-agent/nextpy / PageData

Class PageData

nextpy/backend/state.py:86–109  ·  view source on GitHub ↗

An object containing page data.

Source from the content-addressed store, hash-verified

84
85
86class PageData(Base):
87 """An object containing page data."""
88
89 host: str = "" # repeated with self.headers.origin (remove or keep the duplicate?)
90 path: str = ""
91 raw_path: str = ""
92 full_path: str = ""
93 full_raw_path: str = ""
94 params: dict = {}
95
96 def __init__(self, router_data: Optional[dict] = None):
97 """Initalize the PageData object based on router_data.
98
99 Args:
100 router_data: the router_data dict.
101 """
102 super().__init__()
103 if router_data:
104 self.host = router_data.get(constants.RouteVar.HEADERS, {}).get("origin")
105 self.path = router_data.get(constants.RouteVar.PATH, "")
106 self.raw_path = router_data.get(constants.RouteVar.ORIGIN, "")
107 self.full_path = f"{self.host}{self.path}"
108 self.full_raw_path = f"{self.host}{self.raw_path}"
109 self.params = router_data.get(constants.RouteVar.QUERY, {})
110
111
112class SessionData(Base):

Callers 2

RouterDataClass · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected