yaml2ical/arbiter/schedule.py
Lance Bragstad 7dd6117659 Refactor schedule class into its own module
Previously, the schedule class was in the meeting module with the
meeting class. This change pulls schedule into its own module. This will
be easier for unit testing and will make it is easier for us to change
in the future if we want to incorporate the schedule class purpose into
the meeting object.

Change-Id: I3f03c2167997b39fadd362bd66a35cae570503ef
2014-05-31 02:26:55 +00:00

31 lines
1005 B
Python

#! /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']