示例#1
0
def main(argv):
    # TODO: Make this safe and user friendly and shit
    csvfile = argv[1]
    calendarName = argv[2]

    # Initialize yahoo scraper and google calendar services
    ec = EarningsDateCalculator(csvfile)
    cal = MyCalendar(argv[3:])
    testCalendarId = cal.getCalendarId(calendarName)

    # Generate and add calendar events
    for symbol in ec.companies:
        description = ec.companiesdict[symbol]
        date = ec.getdate(symbol)
        created_event = cal.addEvent(testCalendarId,
                                     "%s,%s" % (symbol, description), date)
        print 'Successfully Created event %s %s' % (created_event['summary'],
                                                    created_event['id'])
示例#2
0
def main(argv):
    mc = MyCalendar(argv)
    testGetCalendars(mc)
    testGetCalendarId(mc, "Test Calendar")
    calId = mc.getCalendarId("Test Calendar")
    testAddEvent(mc, calId, "AXP", "16-Apr-14")