git.ucc.asn.au
/
frenchie
/
icalparse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into cgi
[frenchie/icalparse.git]
/
parserrules.py
diff --git
a/parserrules.py
b/parserrules.py
index
cf60f98
..
f1c55c1
100644
(file)
--- a/
parserrules.py
+++ b/
parserrules.py
@@
-28,6
+28,9
@@
import vobject
import vobject
+ruleConfig = {}
+ruleConfig["defaultTZ"] = "UTC"
+
def facebookOrganiser(cal):
'''Adds organiser details to the body of facebook calendars.'''
def facebookOrganiser(cal):
'''Adds organiser details to the body of facebook calendars.'''
@@
-104,8
+107,7
@@
def exDate(cal):
from datetime import datetime
from pytz import timezone
from datetime import datetime
from pytz import timezone
- default = timezone('Australia/Perth')
-
+ default = timezone(ruleConfig["defaultTZ"])
for event in cal.vevent_list:
if not event.contents.has_key(u'exdate'): continue
for event in cal.vevent_list:
if not event.contents.has_key(u'exdate'): continue
@@
-123,12
+125,13
@@
def exDate(cal):
return cal
def utcise(cal):
return cal
def utcise(cal):
- '''Removing local timezones in favour of UTC'''
+ '''Removing local timezones in favour of UTC. If the remote calendar specifies a timezone
+ then use it, otherwise assume it's in the user-specified or default values'''
from datetime import datetime
from pytz import timezone
from datetime import datetime
from pytz import timezone
- default = timezone(
'Australia/Perth'
)
+ default = timezone(
ruleConfig["defaultTZ"]
)
for event in cal.vevent_list:
dtstart = getattr(event, 'dtstart', None)
for event in cal.vevent_list:
dtstart = getattr(event, 'dtstart', None)
@@
-163,7
+166,8
@@
def unwantedParams(cal):
return cal
def exDate(cal):
return cal
def exDate(cal):
- '''Changes multi-EXDATE into singles (apple can't obey even simple specs)'''
+ '''Changes multi-EXDATE into singles (apple can't obey even simple specs).
+ If the remote calendar specifies a timezone then use it, otherwise use the user specified value'''
for event in cal.vevent_list:
if not event.contents.has_key(u'exdate'): continue
for event in cal.vevent_list:
if not event.contents.has_key(u'exdate'): continue
UCC
git Repository :: git.ucc.asn.au