Skip to content

Commit c181974

Browse files
author
Richard Jones
committed
fixed [SF#474749] Indentations lost
1 parent 542f971 commit c181974

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Fixed:
99
. roundup-server now works on Windows, thanks Juergen Hermann.
1010
. Fixed install documentation, also thanks Juergen Hermann.
1111
. Fixed some URL issues in roundup.cgi, again thanks Juergen Hermann.
12+
. bug #474749 ] indentations lost
1213

1314
2001-10-23 - 0.3.0 pre 3
1415
Feature:
@@ -44,6 +45,7 @@ Fixed:
4445
. bug #473126: Sender unknown
4546
. bug #473130: Nosy list not set correctly
4647

48+
4749
2001-10-11 - 0.3.0 pre 2
4850
Fixed:
4951
. Hyperdatabase was inserting empty strings instead of None for missing

MIGRATION.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,10 @@ If you have modified your dbinit.py file, you may use encoded passwords:
7070

7171
roundup-admin -i <instance home> set user1 password=<new password>
7272

73+
74+
Configuration
75+
-------------
76+
FILTER_POSITION, ANONYMOUS_ACCESS, ANONYMOUS_REGISTER have been added to
77+
the instance_config.py. Simplest solution is to copy the default values from
78+
template in the core source.
79+

roundup/mailgw.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272
an exception, the original message is bounced back to the sender with the
7373
explanatory message given in the exception.
7474
75-
$Id: mailgw.py,v 1.24 2001-10-23 22:57:52 richard Exp $
75+
$Id: mailgw.py,v 1.25 2001-10-28 23:22:28 richard Exp $
7676
'''
7777

7878

@@ -408,12 +408,21 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
408408
character are considered "quoting sections". The first line of the first
409409
non-quoting section becomes the summary of the message.
410410
'''
411-
sections = blank_line.split(content)
411+
# strip off leading carriage-returns / newlines
412+
i = 0
413+
for i in range(len(content)):
414+
if content[i] not in '\r\n':
415+
break
416+
if i > 0:
417+
sections = blank_line.split(content[i:])
418+
else:
419+
sections = blank_line.split(content)
420+
412421
# extract out the summary from the message
413422
summary = ''
414423
l = []
415424
for section in sections:
416-
section = section.strip()
425+
#section = section.strip()
417426
if not section:
418427
continue
419428
lines = eol.split(section)
@@ -432,6 +441,9 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
432441

433442
#
434443
# $Log: not supported by cvs2svn $
444+
# Revision 1.24 2001/10/23 22:57:52 richard
445+
# Fix unread->chatting auto transition, thanks Roch'e
446+
#
435447
# Revision 1.23 2001/10/21 04:00:20 richard
436448
# MailGW now moves 'unread' to 'chatting' on receiving e-mail for an issue.
437449
#

test/test_mailsplit.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: test_mailsplit.py,v 1.7 2001-10-23 00:57:32 richard Exp $
18+
# $Id: test_mailsplit.py,v 1.8 2001-10-28 23:22:28 richard Exp $
1919

2020
import unittest, cStringIO
2121

@@ -95,12 +95,25 @@ def testEmpty(self):
9595
self.assertEqual(summary, '')
9696
self.assertEqual(content, '')
9797

98+
def testIndentationSummary(self):
99+
s = ' Four space indent.\n\n Four space indent.\nNo indent.'
100+
summary, content = parseContent(s)
101+
self.assertEqual(summary, ' Four space indent.')
102+
103+
def testIndentationContent(self):
104+
s = ' Four space indent.\n\n Four space indent.\nNo indent.'
105+
summary, content = parseContent(s)
106+
self.assertEqual(content, s)
107+
98108
def suite():
99109
return unittest.makeSuite(MailsplitTestCase, 'test')
100110

101111

102112
#
103113
# $Log: not supported by cvs2svn $
114+
# Revision 1.7 2001/10/23 00:57:32 richard
115+
# Removed debug print from mailsplit test.
116+
#
104117
# Revision 1.6 2001/10/21 03:35:13 richard
105118
# bug #473125: Paragraph in e-mails
106119
#

0 commit comments

Comments
 (0)