diff --git a/arbiter/meeting.py b/arbiter/meeting.py index 88268ee..6fc8a33 100644 --- a/arbiter/meeting.py +++ b/arbiter/meeting.py @@ -23,7 +23,8 @@ import icalendar import pytz import yaml -import const +from arbiter import const +from arbiter import schedule class Meeting: @@ -41,7 +42,10 @@ class Meeting: self.agenda = yaml['agenda'] # this is a list of list of topics # create schedule objects - self.schedules = [Schedule(schedule) for schedule in yaml['schedule']] + self.schedules = [] + for sch in yaml['schedule']: + s = schedule.Schedule(sch) + self.schedules.append(s) def write_ical(self, ical_dir): """Write this meeting to disk using the iCal format.""" @@ -129,18 +133,6 @@ class Meeting: return meetings -class Schedule: - """A meeting schedule.""" - - def __init__(self, sched_yaml): - """Initialize schedule from yaml.""" - - self.time = datetime.datetime.strptime(sched_yaml['time'], '%H%M') - self.day = sched_yaml['day'] - self.irc = sched_yaml['irc'] - self.freq = sched_yaml['frequency'] - - def next_weekday(ref_date, weekday): """Return the date of the next weekday after ref_date.""" diff --git a/arbiter/schedule.py b/arbiter/schedule.py new file mode 100644 index 0000000..76978f6 --- /dev/null +++ b/arbiter/schedule.py @@ -0,0 +1,30 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2014 OpenStack Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import datetime + + +class Schedule: + """A meeting schedule.""" + + def __init__(self, sched_yaml): + """Initialize schedule from yaml.""" + + self.time = datetime.datetime.strptime(sched_yaml['time'], '%H%M') + self.day = sched_yaml['day'] + self.irc = sched_yaml['irc'] + self.freq = sched_yaml['frequency']