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

Method back

BrowserHistory/backend.py:59–75  ·  view source on GitHub ↗

Returns - str Input - int ---------- - Moves backwards through history up to available steps - Updates navigation counters - Returns current page URL

(self, steps: int)

Source from the content-addressed store, hash-verified

57 self._back_count += 1
58
59 def back(self, steps: int) -> str:
60 """
61 Returns - str
62 Input - int
63 ----------
64 - Moves backwards through history up to available steps
65 - Updates navigation counters
66 - Returns current page URL
67 """
68 # Only traverse available nodes
69 steps = min(steps, self._back_count)
70 while steps > 0:
71 self._curr = self._curr.prev
72 steps -= 1
73 self._back_count -= 1
74 self._forward_count += 1
75 return self._curr.val
76
77 def forward(self, steps: int) -> str:
78 """

Callers 5

backend.pyFile · 0.80
test_visitMethod · 0.80
test_back_navigationMethod · 0.80

Calls

no outgoing calls

Tested by 4

test_visitMethod · 0.64
test_back_navigationMethod · 0.64