- Add an experimental patch to use local TZ in notify mail Date:

header (default off).
- Alter indent in patch-Notify.py to improve readability.
This commit is contained in:
Jun Kuriyama 2006-08-22 11:15:36 +00:00
parent 0774425e0e
commit 0f2ab9c1d6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=171192
3 changed files with 23 additions and 6 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= trac
PORTVERSION= 0.9.6
PORTREVISION= 1
CATEGORIES= japanese www devel python
MASTER_SITES= http://dist.bsdlab.org/ \
http://www.i-act.co.jp/project/products/downloads/
@ -22,7 +23,8 @@ BUILD_DEPENDS= ${PYTHON_SITELIBDIR}/pysqlite2/__init__.py:${PORTSDIR}/databases/
RUN_DEPENDS= ${BUILD_DEPENDS}
OPTIONS= SILVERCITY "Use Silvercity for syntax highlighting" On \
DOCUTILS "Allow additional text markup" On
DOCUTILS "Allow additional text markup" On \
LOCALTZ "Use local TZ in notify mail Date: header" Off
CONFLICTS= trac-0.*
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-ja-1
@ -61,4 +63,8 @@ RUN_DEPENDS+= ${PREFIX}/bin/source2html.py:${PORTSDIR}/textproc/silvercity
RUN_DEPENDS+= ${PREFIX}/bin/rst2html:${PORTSDIR}/textproc/py-docutils
.endif
.if defined(WITH_LOCALTZ)
EXTRA_PATCHES= ${FILESDIR}/extra-patch-Notify.py
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,11 @@
--- trac/Notify.py.orig2 Tue Aug 22 19:47:42 2006
+++ trac/Notify.py Tue Aug 22 19:48:00 2006
@@ -139,7 +139,7 @@
msg['Sender'] = self.from_email
msg['Reply-To'] = self.replyto_email
msg['To'] = rcpt
- msg['Date'] = formatdate()
+ msg['Date'] = formatdate(time.time(), self.config.getbool('notification', 'local_timezone'))
for hdr in mime_headers.keys():
msg[hdr] = mime_headers[hdr]
self.env.log.debug("Sending SMTP notification to %s on port %d"

View File

@ -15,8 +15,8 @@
- msg = MIMEMultipart()
- msg.attach(MIMEText(body, 'plain', 'utf-8'))
- msg.epilogue = ''
+ body_esc = string.replace(unicode(body, 'utf-8'), u'\uff5e', u'\u301c')
+ body = body_esc.encode('japanese.c.iso-2022-jp')
+ body_esc = string.replace(unicode(body, 'utf-8'), u'\uff5e', u'\u301c')
+ body = body_esc.encode('japanese.c.iso-2022-jp')
+ msg = MIMEText(body, 'plain', 'iso-2022-jp')
msg['X-Mailer'] = 'Trac %s, by Edgewall Software' % __version__
msg['X-Trac-Version'] = __version__
@ -24,9 +24,9 @@
msg['X-Trac-Project'] = projname
msg['X-URL'] = self.config.get('project','url')
- msg['Subject'] = Header(self.subject, 'utf-8')
+ subj = unicode(self.subject, 'utf-8')
+ subj_esc = string.replace(subj, u'\uff5e', u'\u301c')
+ msg['Subject'] = Header(subj_esc.encode('japanese.c.iso-2022-jp'), 'iso-2022-jp')
+ subj = unicode(self.subject, 'utf-8')
+ subj_esc = string.replace(subj, u'\uff5e', u'\u301c')
+ msg['Subject'] = Header(subj_esc.encode('japanese.c.iso-2022-jp'), 'iso-2022-jp')
msg['From'] = '%s <%s>' % (projname, self.from_email)
msg['Sender'] = self.from_email
msg['Reply-To'] = self.replyto_email