MCPcopy
hub / github.com/mikumifa/biliTickerBuy / emit

Function emit

task/buy.py:208–223  ·  view source on GitHub ↗
(
        kind: str,
        message: str | None,
        update: BuyStreamUpdate | None = None,
    )

Source from the content-addressed store, hash-verified

206 state = BuyStreamState()
207
208 def emit(
209 kind: str,
210 message: str | None,
211 update: BuyStreamUpdate | None = None,
212 ):
213 if update is not None:
214 update.apply_to(state)
215 if message is not None:
216 state.last_message = message
217
218 return BuyStreamEvent(
219 kind=kind,
220 message=message,
221 state=copy.deepcopy(state),
222 data=update.to_dict() if update is not None else {},
223 )
224
225 def handle_proxy_failure(
226 reason: str,

Callers 4

handle_proxy_failureFunction · 0.85
handle_non_json_responseFunction · 0.85
emit_reprepareFunction · 0.85
buy_streamFunction · 0.85

Calls 3

BuyStreamEventClass · 0.90
apply_toMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected