MCPcopy Create free account
hub / github.com/pyinvoke/invoke / submit

Method submit

invoke/watchers.py:130–145  ·  view source on GitHub ↗
(self, stream: str)

Source from the content-addressed store, hash-verified

128 self.tried = False
129
130 def submit(self, stream: str) -> Generator[str, None, None]:
131 # Behave like regular Responder initially
132 response = super().submit(stream)
133 # Also check stream for our failure sentinel
134 failed = self.pattern_matches(stream, self.sentinel, "failure_index")
135 # Error out if we seem to have failed after a previous response.
136 if self.tried and failed:
137 err = 'Auto-response to r"{}" failed with {!r}!'.format(
138 self.pattern, self.sentinel
139 )
140 raise ResponseNotAccepted(err)
141 # Once we see that we had a response, take note
142 if response:
143 self.tried = True
144 # Again, behave regularly by default.
145 return response

Calls 3

ResponseNotAcceptedClass · 0.85
pattern_matchesMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected