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)
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)
def test_calendar_store_construction_from_string(html_string): store = nyucal.CalendarStore(html_string) assert isinstance(store, nyucal.CalendarStore)
def calendar_store(request, html_file): return nyucal.CalendarStore(html_file)
def test_calendar_store_construction_from_url(): store = nyucal.CalendarStore(nyucal.SOURCE_URL) assert isinstance(store, nyucal.CalendarStore)