MCPcopy Index your code
hub / github.com/geekcomputers/Python / visit

Method visit

BrowserHistory/backend.py:36–57  ·  view source on GitHub ↗

Returns - None Input - str ---------- - Adds the current url to the DLL - Sets both the next and previous values - Cleans up forward history to prevent memory leaks - Resets forward count and increments back count

(self, url: str)

Source from the content-addressed store, hash-verified

34 self._forward_count = 0
35
36 def visit(self, url: str) -> None:
37 """
38 Returns - None
39 Input - str
40 ----------
41 - Adds the current url to the DLL
42 - Sets both the next and previous values
43 - Cleans up forward history to prevent memory leaks
44 - Resets forward count and increments back count
45 """
46 # Clear forward history to prevent memory leaks
47 self._curr.nxt = None
48 self._forward_count = 0
49
50 # Create and link new node
51 url_node = DLL(url)
52 self._curr.nxt = url_node
53 url_node.prev = self._curr
54
55 # Update current node and counts
56 self._curr = url_node
57 self._back_count += 1
58
59 def back(self, steps: int) -> str:
60 """

Callers 5

backend.pyFile · 0.80
test_visitMethod · 0.80
test_back_navigationMethod · 0.80

Calls 1

DLLClass · 0.85

Tested by 4

test_visitMethod · 0.64
test_back_navigationMethod · 0.64