3
Experimental script to export GTimeLog data to iCalendar file.
9
# Hardcoded date range and output file
10
d1 = datetime.datetime(2005, 2, 1)
11
d2 = datetime.datetime.now()
12
outputfile = 'calendar.ics'
14
settings = gtimelog.Settings()
15
configdir = os.path.expanduser('~/.gtimelog')
16
settings_file = os.path.join(configdir, 'gtimelogrc')
17
if os.path.exists(settings_file):
18
settings.load(settings_file)
19
timelog = gtimelog.TimeLog(os.path.join(configdir, 'timelog.txt'),
20
settings.virtual_midnight)
21
window = timelog.window_for(d1, d2)
22
window.icalendar(open(outputfile, 'w'))