2
# Copyright (c) 2007-2011 Cyrus Daboo. All rights reserved.
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
8
# http://www.apache.org/licenses/LICENSE-2.0
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
17
from pycalendar.timezone import PyCalendarTimezone
19
class PyCalendarManager(object):
21
sICalendarManager = None
24
self.mDefaultTimezone = PyCalendarTimezone()
26
def initManager(self):
27
# TODO: - read in timezones from vtimezones.ics file
29
# Eventually we need to read these from prefs - for now they are
30
# hard-coded to my personal prefs!
31
self.setDefaultTimezone(PyCalendarTimezone(utc=False, tzid="US/Eastern"))
33
def setDefaultTimezoneID(self, tzid):
36
temp = PyCalendarTimezone(utc=True)
37
self.setDefaultTimezone(temp)
39
temp = PyCalendarTimezone(utc=False, tzid=tzid)
40
self.setDefaultTimezone(temp)
42
def setDefaultTimezone(self, tzid):
43
self.mDefaultTimezone = tzid
45
def getDefaultTimezoneID(self):
46
if self.mDefaultTimezone.getUTC():
49
return self.mDefaultTimezone.getTimezoneID()
51
def getDefaultTimezone(self):
52
return self.mDefaultTimezone
54
PyCalendarManager.sICalendarManager = PyCalendarManager()