Beispiel #1
0
def reminderEvents_bbq(cs, url, start, stop):
    strstart = start.strftime("%Y-%m-%dT%H:%M:%S.000") + lib.Tz2Str()
    strstop = stop.strftime("%Y-%m-%dT%H:%M:%S.000") + lib.Tz2Str()
    feed = lib.DateQuery(cs, url, strstart, strstop)
    events = feed
    # events = feed.entry
    if not events:
        return
    events.sort(cmp=lib.SortEvent)
    events = filter(lambda x: lib.KeepEvent(x, True, True), events)
    for e in events:
        try:
            einfo = getEvent(e)
            estart = lib.Goog2Dt(einfo['start'])
            estop = lib.Goog2Dt(einfo['end'])
            if (estart >= start) and (estart < stop):
                sendReminderEmail_bbq(einfo['name'], einfo['email'],
                                      einfo['etitle'],
                                      lib.Goog2Str(einfo['start']),
                                      lib.Goog2Str(einfo['end']))
        except:
            f = open('error_log.txt', 'a')
            f.write(einfo['name'] + ', ' + einfo['email'] + ', ' +
                    einfo['etitle'] + ', ' + start + ', ' + stop)
            f.write(sys.exc_info()[0])
            f.close()
            continue
Beispiel #2
0
def cleaningEvents(cs, url, start, stop):
    strstart = start.strftime("%Y-%m-%dT%H:%M:%S.000") + lib.Tz2Str()
    strstop = stop.strftime("%Y-%m-%dT%H:%M:%S.000") + lib.Tz2Str()
    feed = lib.DateQuery(cs, url, strstart, strstop)
    events = feed
    # events = feed.entry
    if not events:
        return
    events.sort(cmp=lib.SortEvent)
    events = filter(lambda x: lib.KeepEvent(x, True, True), events)
    for e in events:
        try:
            einfo = getEvent(e)
            estart = lib.Goog2Dt(einfo['start'])
            estop = lib.Goog2Dt(einfo['end'])
            if (estop >= (start + timedelta(minutes=15))) and (
                    estop < (stop + timedelta(minutes=15))):
                print "sending the cleaning email"
                sendCleaningEmail(einfo['name'],
                                  einfo['email'], einfo['etitle'],
                                  lib.Goog2Str(einfo['start']),
                                  lib.Goog2Str(einfo['end']))
        except:
            f = open('error_log.txt', 'a')
            f.write(einfo['name'] + ', ' + einfo['email'] + ', ' +
                    einfo['etitle'] + ', ' + start + ', ' + stop)
            f.write(sys.exc_info()[0])
            f.close()
            continue
Beispiel #3
0
    <p class="right">
     <a href="%(admin)s">Admin</a>
    </p>
    <div class="clear"></div>
   </h3>
   <hr>
   Your form submission generated the following errors and warnings.
   Please go back and try again.
   %(errors)s
  </div>
 </body>
</html>
""" % {'css':lib.css,'errors':errors,'main':lib.main,'form':lib.form, \
       'admin':lib.admin}
        else:
            fstart = dstart + 'T00:00:00.000' + lib.Tz2Str()
            fend = dend + 'T00:00:00.000' + lib.Tz2Str()
            tabhtml = u''.join([
                GetArea(a, fstart, fend, paid, unpaid) for a in lib.areas
            ]).encode('utf-8').strip()
            print 'Content-type: text/html'
            print
            print \
"""
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>Payment Verification</title>
  <link rel="stylesheet" href="%(css)s" type="text/css">
  <script language="javascript" type="text/javascript">
   function toggle(row) {