Changeset 4154 for announcerplugin/0.11
- Timestamp:
- 08/19/08 12:34:57 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
announcerplugin/0.11/announcerplugin/distributors/email_distributor.py
r4146 r4154 13 13 from email.MIMEText import MIMEText 14 14 from email.Utils import formatdate 15 from email.header import Header 15 16 import time, Queue, threading, smtplib 16 17 … … 224 225 subject = formatter.format_subject(transport, event.realm, format, event) 225 226 227 charset = self.env.config.get('trac', 'default_charset') or 'utf-8' 226 228 alternate_format = formatter.get_format_alternative(transport, event.realm, format) 227 229 if alternate_format: … … 246 248 247 249 rootMessage['Date'] = formatdate() 248 rootMessage['Subject'] = subject250 rootMessage['Subject'] = Header(subject, charset) 249 251 rootMessage['From'] = self.smtp_from 250 252 if to: … … 262 264 263 265 if alternate_output: 264 msgText = MIMEText(alternate_output, 'html' in alternate_format and 'html' or 'plain' )266 msgText = MIMEText(alternate_output, 'html' in alternate_format and 'html' or 'plain', charset) 265 267 parentMessage.attach(msgText) 266 268 267 msgText = MIMEText(output, 'html' in format and 'html' or 'plain' )269 msgText = MIMEText(output, 'html' in format and 'html' or 'plain', charset) 268 270 parentMessage.attach(msgText) 269 271 announcerplugin/0.11/announcerplugin/subscribers/watchers.py
r3107 r4154 77 77 AND category=%s 78 78 AND rule=%s 79 """, (sid, authenticated and 1 or 0, 'watcher', realm, '*', resource))79 """, (sid, int(authenticated), 'watcher', realm, '*', str(resource))) 80 80 81 81 result = cursor.fetchone() … … 103 103 %s, %s) 104 104 """, ( 105 sid, authenticated,105 sid, int(authenticated), 106 106 'watcher', realm, '*', 107 107 resource, 'email' … … 127 127 AND category=%s 128 128 AND rule=%s 129 """, (sid, authenticated, 'watcher', realm, '*', resource))129 """, (sid, int(authenticated), 'watcher', realm, '*', str(resource))) 130 130 131 131 if not use_db: … … 198 198 AND realm=%s 199 199 AND rule=%s 200 """, ('watcher', 'wiki', page.name))200 """, ('watcher', 'wiki', str(page.name))) 201 201 202 202 db.commit() … … 224 224 AND realm=%s 225 225 AND rule=%s 226 """, ('watcher', 'ticket', ticket.id))226 """, ('watcher', 'ticket', str(ticket.id))) 227 227 228 228 db.commit() … … 249 249 AND category=%s 250 250 AND rule=%s 251 """, ('watcher', event.realm, '*', self._get_target_identifier(event.realm, event.target))) 251 """, ('watcher', event.realm, '*', 252 self._get_target_identifier(event.realm, 253 str(event.target)))) 252 254 253 255 for transport, sid, authenticated in cursor.fetchall():
