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:
f044586
)
Checks for the correct opening stanza
author
James French
<
[email protected]
>
Mon, 2 Aug 2010 04:54:00 +0000
(12:54 +0800)
committer
James French
<
[email protected]
>
Mon, 2 Aug 2010 04:54:00 +0000
(12:54 +0800)
icalparse.py
patch
|
blob
|
history
diff --git
a/icalparse.py
b/icalparse.py
index
713e9f3
..
110a19a
100755
(executable)
--- a/
icalparse.py
+++ b/
icalparse.py
@@
-30,6
+30,9
@@
class notJoined(Exception): pass
def lineJoiner(oldcal):
'''Takes a string containing a calendar and returns an array of its lines'''
+ if not oldcal[0:15] == 'BEGIN:VCALENDAR':
+ raise InvalidICS, "Does not appear to be a valid ICS file"
+
if list(oldcal) == oldcal:
oldcal = '\r\n'.join(oldcal)
@@
-149,3
+152,5
@@
if __name__ == '__main__':
url = ''
content = getContent(url, options.stdin)
+ cal = lineJoiner(content)
+ print cal
UCC
git Repository :: git.ucc.asn.au