Example #1
0
def list(source):
    """List the available calendars in the calendar source

    Since the calendar store is, by default, scraped from a web page,
    this command will fail if no source is specified and the computer
    is not online.
    """
    store = nyucal.CalendarStore(source)
    for line in store.calendar_names:
        click.echo(line)
Example #2
0
def get(source, name, format, output):
    """Get the calendar named NAME and output in the specified format

    If NAME contains a space, it will need to be quoted.

    Since the calendar store is, by default, scraped from a web page,
    this command will fail if no source is specified and the computer
    is not online.
    """
    store = nyucal.CalendarStore(source)
    calendar = store.calendar(name)
    writers = {'gcalcsv': nyucal.GcalCsvWriter}
    writer = writers[format.lower()](output)
    writer.write(calendar)
Example #3
0
def test_calendar_store_construction_from_string(html_string):
    store = nyucal.CalendarStore(html_string)
    assert isinstance(store, nyucal.CalendarStore)
Example #4
0
def calendar_store(request, html_file):
    return nyucal.CalendarStore(html_file)
Example #5
0
def test_calendar_store_construction_from_url():
    store = nyucal.CalendarStore(nyucal.SOURCE_URL)
    assert isinstance(store, nyucal.CalendarStore)