Changeset 711 for pykota/trunk
- Timestamp:
- 02/06/03 00:55:02 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r709 r711 15 15 # 16 16 # $Log$ 17 # Revision 1.6 2003/02/05 23:55:02 jalet 18 # Cleaner email messages 19 # 17 20 # Revision 1.5 2003/02/05 23:45:09 jalet 18 21 # Better DateTime manipulation wrt grace delay … … 66 69 def sendMessage(self, touser, fullmessage) : 67 70 """Sends an email message containing headers to some user.""" 68 fullmessage += "\n\nPlease contact your system administrator %s - <%s>\n" % (self.admin, self.adminmail)69 71 if "@" not in touser : 70 72 touser = "%s@%s" % (touser, self.smtpserver) … … 75 77 def sendMessageToUser(self, username, subject, message) : 76 78 """Sends an email message to a user.""" 79 message += "\n\nPlease contact your system administrator :\n\n\t%s - <%s>\n" % (self.admin, self.adminmail) 77 80 self.sendMessage(username, "Subject: %s\n\n%s" % (subject, message)) 78 81 … … 118 121 adminmessage = "Print Quota exceeded for user %s on printer %s" % (username, self.printername) 119 122 self.logger.log_message(adminmessage) 120 self.sendMessageToUser(username, "Print Quota Exceeded", "You are not allowed to print anymore because 123 self.sendMessageToUser(username, "Print Quota Exceeded", "You are not allowed to print anymore because\nyour Print Quota is exceeded.") 121 124 self.sendMessageToAdmin("Print Quota", adminmessage) 122 125 elif action == "WARN" : 123 126 adminmessage = "Print Quota soft limit exceeded for user %s on printer %s" % (username, self.printername) 124 127 self.logger.log_message(adminmessage) 125 self.sendMessageToUser(username, "Print Quota Exceeded", "You will soon be forbidden to print anymore because 128 self.sendMessageToUser(username, "Print Quota Exceeded", "You will soon be forbidden to print anymore because\nyour Print Quota is almost reached.") 126 129 self.sendMessageToAdmin("Print Quota", adminmessage) 127 130 return action