コード例 #1
0
ファイル: run.py プロジェクト: imclab/ARCADE2ics
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)
コード例 #2
0
ファイル: run.py プロジェクト: imclab/ARCADE2ics
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
ファイル: direct.py プロジェクト: tomjnixon/ARCADE2ics
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)
コード例 #4
0
ファイル: email.py プロジェクト: tomjnixon/ARCADE2ics
def get_events():
    parts, time_stamp = inbox.get_recent_sessions(config.mailbox)
    return convert.get_events_from_parts(parts)