How the main loop catches events.
The current way listeners work is really a band-aid. Currently you add you'r modules listener function as part of a dictionary, with it's key being the listener. Only single character listeners work. Also, only one module can operate on a given listener. instead of manually adding a modules listener to a listener list, I think we need to changes things to work with an Irc.addListener() function.
I'm thinking this can be handled like this:
Irc.addListener
listenerString is just the listener that the function would be added to, like '!'.
listenBox is a tuple (module.
functions is another tuple, holding all the strings that the module listens on.
to add factoids to this, It would look like:
Irc.
factoids would define it's listen box within.
this would then add all of factoids functions under the '!' listener. Factoids is a bit unique because it contains a catchall listener. Obviously a given base listener can only have on catchall listener.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- BrandonTomlinson
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- BrandonTomlinson