fixed events plugin to create output folder if missing
This commit is contained in:
parent
6397007d04
commit
aa0ebc7011
|
@ -83,7 +83,7 @@ def parse_recursion(ev, field_name):
|
||||||
freq = chunks[0].upper()
|
freq = chunks[0].upper()
|
||||||
if 'until' in chunks:
|
if 'until' in chunks:
|
||||||
until = datetime.strptime(chunks[-1], '%Y-%m-%d')
|
until = datetime.strptime(chunks[-1], '%Y-%m-%d')
|
||||||
rrule = [freq, until]
|
rrule = [freq, until]
|
||||||
else:
|
else:
|
||||||
rrule = [freq]
|
rrule = [freq]
|
||||||
return rrule
|
return rrule
|
||||||
|
@ -126,6 +126,9 @@ def generate_ical_file(generator):
|
||||||
if not ics_fname:
|
if not ics_fname:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not os.path.exists(generator.settings['OUTPUT_PATH']):
|
||||||
|
os.makedirs(generator.settings['OUTPUT_PATH'])
|
||||||
|
|
||||||
ics_fname = os.path.join(generator.settings['OUTPUT_PATH'], ics_fname)
|
ics_fname = os.path.join(generator.settings['OUTPUT_PATH'], ics_fname)
|
||||||
log.debug("Generating calendar at %s with %d events" % (ics_fname, len(events)))
|
log.debug("Generating calendar at %s with %d events" % (ics_fname, len(events)))
|
||||||
|
|
||||||
|
@ -148,7 +151,7 @@ def generate_ical_file(generator):
|
||||||
|
|
||||||
ie = icalendar.Event(
|
ie = icalendar.Event(
|
||||||
summary=e.metadata['title'],
|
summary=e.metadata['title'],
|
||||||
dtstart=dtstart,
|
dtstart=dtstart,
|
||||||
dtend=dtend,
|
dtend=dtend,
|
||||||
dtstamp= dtstamp,
|
dtstamp= dtstamp,
|
||||||
priority=5,
|
priority=5,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user