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:
8dcab4a
)
Removed erroneous comments
author
James French
<
[email protected]
>
Tue, 3 Aug 2010 05:02:37 +0000
(13:02 +0800)
committer
James French
<
[email protected]
>
Tue, 3 Aug 2010 05:02:37 +0000
(13:02 +0800)
icalparse.py
patch
|
blob
|
history
diff --git
a/icalparse.py
b/icalparse.py
index
f4b8877
..
193a00a
100755
(executable)
--- a/
icalparse.py
+++ b/
icalparse.py
@@
-64,24
+64,14
@@
def lineFolder(oldcal, length=75):
ll = length
foldedline = []
while uline:
ll = length
foldedline = []
while uline:
- # This algorithm prevents slicing multi-byte chars in half
-
- # Convert up to length octets to unicode, dropping any
- # half characters
ufold = unicode(line[0:ll], 'utf-8', 'ignore')
fold = ufold.encode('utf-8')
ufold = unicode(line[0:ll], 'utf-8', 'ignore')
fold = ufold.encode('utf-8')
-
- # Remove what we've converted from the line
uline = uline.replace(ufold,u'',1)
line = uline.encode('utf-8')
uline = uline.replace(ufold,u'',1)
line = uline.encode('utf-8')
-
- # And add the fold to the list
foldedline.append(fold)
# Subsequent lines are shorter as they include a space
ll = length - 1
foldedline.append(fold)
# Subsequent lines are shorter as they include a space
ll = length - 1
-
- # Finally, add the fold 'marker' to the line
cal.append('\r\n '.join(foldedline))
return cal
cal.append('\r\n '.join(foldedline))
return cal
UCC
git Repository :: git.ucc.asn.au