示例#1
0
def main():
    args = parse_args()

    yaml_dir = os.path.abspath(args.yaml_dir)
    _check_if_location_exists(yaml_dir, style='d')

    meetings = meeting.load_meetings(yaml_dir)
    # Check uniqueness and conflicts here before writing out to .ics
    meeting.check_for_meeting_conflicts(meetings)

    if args.ical_dir:
        ical_dir = _prepare_output(args.ical_dir, style='d', force=args.force)
        ical.convert_meetings_to_ical(meetings, outputdir=ical_dir)
    else:
        icalfile = _prepare_output(args.icalfile, force=args.force)
        ical.convert_meetings_to_ical(meetings, outputfile=icalfile,
                                      caldescription=args.caldescription,
                                      calname=args.calname)

    if args.index_template and args.index_output:
        index_template = os.path.abspath(args.index_template)
        _check_if_location_exists(index_template)
        index_output = _prepare_output(args.index_output, force=args.force)
        index.convert_meetings_to_index(
            meetings, index_template, index_output)
示例#2
0
 def should_not_conflict(self, yaml1, yaml2):
     """No exception raised when meetings shouldn't conflict."""
     meeting_one = meeting.load_meetings(yaml1)
     meeting_two = meeting.load_meetings(yaml2)
     meeting_list = [meeting_one.pop(), meeting_two.pop()]
     meeting.check_for_meeting_conflicts(meeting_list)
示例#3
0
 def should_not_conflict(self, yaml1, yaml2):
     """No exception raised when meetings shouldn't conflict."""
     meeting_one = meeting.load_meetings(yaml1)
     meeting_two = meeting.load_meetings(yaml2)
     meeting_list = [meeting_one.pop(), meeting_two.pop()]
     meeting.check_for_meeting_conflicts(meeting_list)