diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ed1fe2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# emacs +*~ diff --git a/src/jobs.py b/src/jobs.py new file mode 100644 index 0000000..a2823fb --- /dev/null +++ b/src/jobs.py @@ -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() diff --git a/src/meeting.py b/src/meeting.py new file mode 100644 index 0000000..b6ad63b --- /dev/null +++ b/src/meeting.py @@ -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 diff --git a/src/util.py b/src/util.py new file mode 100644 index 0000000..84d86c3 --- /dev/null +++ b/src/util.py @@ -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 +