Ejemplo n.º 1
0
def run_with_input(parts, time_stamp):
    """Write an .ics file to the place specified in config,
    chmod-ing to 644. This is the common function of all run_*.py files.
    """
    # Get event objects from parts.
    events = convert.get_events_from_parts(parts) + list(exams.get_exam_events())
    # Write the iCal file.
    convert.write_cal(events, time_stamp, config.ical)
    # Make the iCal file readable by all.
    os.chmod(os.path.expanduser(config.ical),
             S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
Ejemplo n.º 2
0
def run_with_input(parts, time_stamp):
    """Write an .ics file to the place specified in config,
    chmod-ing to 644. This is the common function of all run_*.py files.
    """
    # Get event objects from parts.
    events = convert.get_events_from_parts(parts) + list(
        exams.get_exam_events())
    # Write the iCal file.
    convert.write_cal(events, time_stamp, config.ical)
    # Make the iCal file readable by all.
    os.chmod(os.path.expanduser(config.ical),
             S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
Ejemplo n.º 3
0
def get_events():
    # Read the descriptions and the table from arcade
    print "Running ARCADE... (cross your fingers now) "

    input = ARCADE.ArcadeClient().getTimetable()

    print "OK! (Probably.)"

    # Get the parts from the ARCADE output.
    parts = inbox.get_parts(input)

    return convert.get_events_from_parts(parts)
Ejemplo n.º 4
0
def get_events():
    parts, time_stamp = inbox.get_recent_sessions(config.mailbox)
    return convert.get_events_from_parts(parts)