MCPcopy
hub / github.com/USArmyResearchLab/Dshell / feed_plugin_chain

Function feed_plugin_chain

dshell/decode.py:62–80  ·  view source on GitHub ↗

Every packet fed into Dshell goes through this function. Its goal is to pass each packet down the chain of selected plugins. Each plugin decides whether the packet(s) will proceed to the next plugin, i.e. act as a filter.

(plugin_index: int, packet: Packet)

Source from the content-addressed store, hash-verified

60
61
62def feed_plugin_chain(plugin_index: int, packet: Packet):
63 """
64 Every packet fed into Dshell goes through this function.
65 Its goal is to pass each packet down the chain of selected plugins.
66 Each plugin decides whether the packet(s) will proceed to the next
67 plugin, i.e. act as a filter.
68 """
69 if plugin_index >= len(plugin_chain):
70 # We are at the end of the chain.
71 return
72
73 current_plugin = plugin_chain[plugin_index]
74
75 # Pass packet into plugin for processing.
76 current_plugin.consume_packet(packet)
77
78 # Process produced packets.
79 for _packet in current_plugin.produce_packets():
80 feed_plugin_chain(plugin_index + 1, _packet)
81
82
83def clean_plugin_chain(plugin_index):

Callers 2

clean_plugin_chainFunction · 0.85
process_filesFunction · 0.85

Calls 2

consume_packetMethod · 0.45
produce_packetsMethod · 0.45

Tested by

no test coverage detected