source file: irc/motd.py
file stats: 9 lines, 9 executed: 100.0% covered
1. #!/usr/bin/env python 2. 3. class motd: 4. 5. _state = None 6. 7. def __init__(self, state): 8. self._state = state 9. state.registerCallback(state.CALLBACK_REQUESTMOTD, self.callbackMOTD) 10. 11. def callbackMOTD(self, (numeric, target)): 12. if target[0] == self._state.getServerID(): 13. self._state.oobmsg((self._state.getServerID(), None), numeric, "375", [self._state.getServerName() + " Message of the Day"]) 14. self._state.oobmsg((self._state.getServerID(), None), numeric, "376", ["End of /MOTD."])