git.ucc.asn.au
/
frenchie
/
icalparse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95b8afd
)
More efficient lineFolder implementation
author
James French
<
[email protected]
>
Mon, 2 Aug 2010 06:35:01 +0000
(14:35 +0800)
committer
James French
<
[email protected]
>
Mon, 2 Aug 2010 06:35:57 +0000
(14:35 +0800)
icalparse.py
patch
|
blob
|
history
diff --git
a/icalparse.py
b/icalparse.py
index
0fd0de7
..
cc548a3
100755
(executable)
--- a/
icalparse.py
+++ b/
icalparse.py
@@
-60,12
+60,13
@@
def lineFolder(oldcal, length=75):
if len(line.rstrip()) <= length:
cal.append(line)
else:
- brokenline = [line[0:length]
+ '\r\n'
]
+ brokenline = [line[0:length]]
ll = length
- while ll < len(line
.rstrip('\r\n')
) + 1:
- brokenline.append(
' ' + line[ll:sl+ll].rstrip('\r\n') + '\r\n'
)
+ while ll < len(line) + 1:
+ brokenline.append(
line[ll:sl+ll]
)
ll += sl
- cal += brokenline
+ brokenline = '\r\n '.join(brokenline)
+ cal.append(brokenline)
return cal
UCC
git Repository :: git.ucc.asn.au