Пример #1
0
def write_events(events):
    """Write an .ics file to the place specified in config,
    chmod-ing to 644.
    """
    # Use the current time as the timestamp (originally came from email).
    time_stamp = datetime.datetime.now(UTC)
    # 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)
Пример #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)
Пример #3
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)