Added skeleton files for different classes.

This commit is contained in:
Josh Tan 2014-02-25 11:24:49 -06:00
parent 08114e5100
commit 78a293c5e4
4 changed files with 92 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# emacs
*~

46
src/jobs.py Normal file
View File

@ -0,0 +1,46 @@
import yaml
import icalendar
import pprint
import sys
from os import listdir, chdir
from os.path import isfile, dirname, join
class MeetingJobs:
"""Executes post, gate, and check jobs."""
# make this a singleton?
def __init__(self, publish_url):
self.publish_url = publish_url
def execute_check():
pass
def execute_gate():
pass
def execute_post():
pass
def pprint_yaml():
"""For now, this is a simple script to import all the yaml files and pretty print it."""
# change the current directory to the meetings directory where all the yaml files are located
os.chdir('../meetings/')
# get a list of all the yaml files
yamlfiles = [f for f in os.listdir() if os.path.isfile(f) and ".yaml" in f]
meeting = []
for f in yaml:
m = open(f, 'r')
meeting.append(yaml.load(m))
# print yaml.load(meeting), used to have sys.out as second before to print to terminal
print yaml.dump(yaml.load(m))
# main
pprint_yaml()

29
src/meeting.py Normal file
View File

@ -0,0 +1,29 @@
class Meeting:
"""An OpenStack meeting."""
def __init__(self, yaml_file):
# create yaml object from yaml file. use it initialize following fields.
self.proj_name = yaml.name
self.uuid = yaml.uuid
self.chair = yaml.chair
self.descript = yaml.descript
self.agenda = yaml.agenda # this is a list of topics
# create schedule object
self.schedule = newly_created_schedule_object
# create checksum from something, perhaps entire object (this would
# be an easy way to check is anything has changed that needs to be
# published)
self.checksum = generated_checksum
class Schedule:
"""A meeting schedule."""
def __init__(self, time, day, irc, period):
self.time = time
self.day = day
self.irc = irc
self.period = period

15
src/util.py Normal file
View File

@ -0,0 +1,15 @@
class MeetingUtil:
"""Utility functions."""
def convert_to_ical(yaml):
pass
def publish(meeting, ical):
pass
def check_conflicts(meeting):
pass
def check_syntax(yaml):
pass