Changeset 852 for pykota/trunk
- Timestamp:
- 03/16/03 00:01:28 (22 years ago)
- Location:
- pykota/trunk
- Files:
-
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r830 r852 48 48 49 49 # 50 # Who should we send an email to in case a quota is reached ? 51 # possible values are : DevNull, User, Admin, Both 52 # The Both value means that the User and the Admin will receive 53 # an email message. 54 # The DevNull value means no email message will be sent. 55 # This value can be set either globally or per printer or both. 56 # If both are defined, the printer option has priority. 57 mailto: both 58 59 # 50 60 # Grace delay in days 51 61 # This value can be set either globally or per printer or both. -
pykota/trunk/NEWS
r846 r852 16 16 PyKota NEWS : 17 17 18 - 1.01 : 19 20 - The configuration file now accepts an option 21 to choose the recipient(s) of the email messages : 22 23 - DevNull means no one will receive them. 24 - User means only the user will receive them. 25 - Admin means only the admin will receive them. 26 - Both means the User and the Admin will receive them. 27 28 - Manual pages are included since 1.00, but I forgot to 29 add this information to this file. 30 18 31 - 1.00 : 19 32 -
pykota/trunk/po/en/pykota.po
r842 r852 15 15 # 16 16 # $Log$ 17 # Revision 1.10 2003/03/15 23:01:28 jalet 18 # New mailto option in configuration file added. 19 # No time to test this tonight (although it should work). 20 # 17 21 # Revision 1.9 2003/03/09 23:38:43 jalet 18 22 # Simplified translations. … … 219 223 msgid "unknown" 220 224 msgstr "" 225 226 msgid "Option mailto in section %s only supports values in %s" 227 msgstr "" -
pykota/trunk/po/fr/pykota.po
r842 r852 15 15 # 16 16 # $Log$ 17 # Revision 1.8 2003/03/15 23:01:28 jalet 18 # New mailto option in configuration file added. 19 # No time to test this tonight (although it should work). 20 # 17 21 # Revision 1.7 2003/03/09 23:38:43 jalet 18 22 # Simplified translations. … … 227 231 msgid "unknown" 228 232 msgstr "inconnu" 233 234 msgid "Option mailto in section %s only supports values in %s" 235 msgstr "L'option mailto dans la section %s supporte seulement les valeurs %s" -
pykota/trunk/po/pykota.pot
r842 r852 15 15 # 16 16 # $Log$ 17 # Revision 1.10 2003/03/15 23:01:28 jalet 18 # New mailto option in configuration file added. 19 # No time to test this tonight (although it should work). 20 # 17 21 # Revision 1.9 2003/03/09 23:38:43 jalet 18 22 # Simplified translations. … … 219 223 msgid "unknown" 220 224 msgstr "" 225 226 msgid "Option mailto in section %s only supports values in %s" 227 msgstr "" -
pykota/trunk/pykota/config.py
r804 r852 15 15 # 16 16 # $Log$ 17 # Revision 1.17 2003/03/15 23:01:28 jalet 18 # New mailto option in configuration file added. 19 # No time to test this tonight (although it should work). 20 # 17 21 # Revision 1.16 2003/02/17 23:01:56 jalet 18 22 # Typos … … 189 193 return self.getPrinterOption(printer, "admin") 190 194 195 def getMailTo(self, printer) : 196 """Returns the recipient of email messages.""" 197 validmailtos = [ "DEVNULL", "BOTH", "USER", "ADMIN" ] 198 mailto = self.getPrinterOption(printer, "mailto").upper() 199 if mailto not in validmailtos : 200 raise PyKotaConfigError, _("Option mailto in section %s only supports values in %s") % (printer, str(validmailtos)) 201 return mailto 202 191 203 def getGraceDelay(self, printer) : 192 204 """Returns the grace delay in days.""" -
pykota/trunk/pykota/tool.py
r844 r852 15 15 # 16 16 # $Log$ 17 # Revision 1.27 2003/03/15 23:01:28 jalet 18 # New mailto option in configuration file added. 19 # No time to test this tonight (although it should work). 20 # 17 21 # Revision 1.26 2003/03/09 23:58:16 jalet 18 22 # Comment … … 312 316 admin = self.config.getAdmin(pname) 313 317 adminmail = self.config.getAdminMail(pname) 318 mailto = self.config.getMailTo(pname) 314 319 action = self.checkUserPQuota(username, pname) 315 320 if action.startswith("POLICY_") : … … 318 323 adminmessage = _("Print Quota exceeded for user %s on printer %s") % (username, pname) 319 324 self.logger.log_message(adminmessage) 320 self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You are not allowed to print anymore because\nyour Print Quota is exceeded on printer %s.") % pname) 321 self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 325 if mailto in [ "BOTH", "USER" ] : 326 self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You are not allowed to print anymore because\nyour Print Quota is exceeded on printer %s.") % pname) 327 if mailto in [ "BOTH", "ADMIN" ] : 328 self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 322 329 elif action == "WARN" : 323 330 adminmessage = _("Print Quota soft limit exceeded for user %s on printer %s") % (username, pname) 324 331 self.logger.log_message(adminmessage) 325 self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You will soon be forbidden to print anymore because\nyour Print Quota is almost reached on printer %s.") % pname) 326 self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 332 if mailto in [ "BOTH", "USER" ] : 333 self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You will soon be forbidden to print anymore because\nyour Print Quota is almost reached on printer %s.") % pname) 334 if mailto in [ "BOTH", "ADMIN" ] : 335 self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 327 336 return action 328 337