MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / _Gate

Class _Gate

scripts/test-impact/profile_text_parser.py:74–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73
74class _Gate:
75 __slots__ = ("cancel", "context", "work")
76
77 def __init__(self, cancel, context):
78 self.cancel = cancel
79 self.context = context
80 self.work = 0
81
82 def poll(self):
83 self.work = 0
84 if self.cancel is None:
85 return
86 answer = self.cancel(self.context)
87 if type(answer) is not bool:
88 raise InvalidArgumentError("cancel must return bool")
89 if answer:
90 raise ParseCancelledError("profile parsing cancelled")
91
92 def step(self):
93 self.work += 1
94 if self.work == _POLL_INTERVAL:
95 self.poll()
96
97
98class _Parser:

Callers 1

parse_profile_textFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected