Merge "Add 'outfile' var that can be used in templates"

This commit is contained in:
Jenkins 2015-06-17 10:00:15 +00:00 committed by Gerrit Code Review
commit 616610813d
2 changed files with 3 additions and 2 deletions

View File

@ -102,8 +102,7 @@ def convert_meetings_to_ical(meetings, outputdir=None, outputfile=None,
for m in meetings:
cal = Yaml2IcalCalendar()
cal.add_meeting(m)
filename = os.path.splitext(m.filefrom)[0] + '.ics'
cal.write_to_disk(os.path.join(outputdir, filename))
cal.write_to_disk(os.path.join(outputdir, m.outfile))
# convert meetings into a single ical
if outputfile:

View File

@ -114,8 +114,10 @@ class Meeting(object):
try:
self.filefrom = os.path.basename(data.name)
self.outfile = os.path.splitext(self.filefrom)[0] + '.ics'
except AttributeError:
self.filefrom = "stdin"
self.outfile = "stdin.ics"
self.schedules = []
for sch in yaml_obj['schedule']: