(self)
| 1458 | self.__writer.write(text) |
| 1459 | |
| 1460 | def update(self): |
| 1461 | # Update the directory monitor once a second. |
| 1462 | self.after(1000, self.update) |
| 1463 | self.__monitor.update(self.__messages.update) |
| 1464 | # For each message, show those less than a day old. |
| 1465 | utcnow = datetime.datetime.utcnow() |
| 1466 | for message in self.__messages.get_messages(): |
| 1467 | hours = (utcnow - message.time).total_seconds() / 3600 |
| 1468 | if hours < SETTINGS.message_cutoff and self.allowed(message): |
| 1469 | self.display(message) |
| 1470 | |
| 1471 | def allowed(self, message): |
| 1472 | # If there is no text, it is not allowed. |
no test coverage detected