Skip to content

Commit 5bd65ab

Browse files
007: remove generator-option
we agreed to not do this
1 parent 154ba19 commit 5bd65ab

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

007/README.md

+3-24
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ In library-mode, IntelMQ tries to load the file, and if it does not exist, loads
130130
## Rationales
131131

132132
### Compatibility
133-
Since the beginning of IntelMQ, the bot's `process` methods use the methods `self.receive_message`, `self.acknowledge_message` and `self.send_message`. Breaking this paradigm and changing to method parameters and return values or generator yields would indicate an API change and thus lead to IntelMQ version 4.0.
134-
To be decided if this should be done.
135-
Maybe as another IEP?
133+
Since the beginning of IntelMQ, the bot's `process` methods use the methods `self.receive_message`, `self.acknowledge_message` and `self.send_message`.
134+
Breaking this paradigm and changing to method parameters and return values or generator yields would indicate an API change and thus lead to IntelMQ version 4.0.
135+
Thus, we stick to the current behavior.
136136

137137
## Specification
138138

@@ -220,24 +220,3 @@ assert sent_messages['output'][0] == MessageFactory.from_dict(test_parser_bot.EX
220220
# this is a dumped message
221221
assert sent_messages['error'][0] == input_message
222222
```
223-
224-
### Option: bot.process_call is a generator
225-
```python
226-
from intelmq.lib.exceptions import IntelMQException
227-
from intelmq.lib.bot import BotLibSettings
228-
229-
EXAMPLE_REPORT = {"feed.url": "http://www.example.com/",
230-
"time.observation": "2015-08-11T13:03:40+00:00",
231-
"raw": utils.base64_encode(RAW),
232-
"__type": "Report",
233-
"feed.name": "Example"}
234-
235-
bot = test_parser_bot.DummyParserBot('dummy-bot', settings=BotLibSettings)
236-
237-
try:
238-
# bot.process_call is a generator
239-
sent_messages = list(bot.process_message(EXAMPLE_REPORT))
240-
# sent_messages is now a list of sent messages
241-
except IntelMQException as exc:
242-
sys.exit('Processing exception')
243-
```

0 commit comments

Comments
 (0)