Пример #1
0
def soundTheAlarm(sessions, contents, droppedSessions):
    body = """
    The number of sessions with flags has gone down!\n
    Sessions that have lost flags are:
    %s

    from:
    %s

    to:
    %s
    """ % (
        "\n".join(droppedSessions),
        "".join(contents),
        "%s\n%s" % (len(sessions), "\n".join(sessions)),
    )
    email = Email(
        sender="*****@*****.**",
        recipients=["*****@*****.**", "*****@*****.**"],
        subject="PHT Session Flags",
        body=body,
        date=datetime.now(),
    )
    emailN = emailNotifier(smtp="smtp.gb.nrao.edu")
    emailN.Send(email)
Пример #2
0
def soundTheAlarm(sessions, contents):
    body  = """
    The number of sessions with flags has gone down!

    from:
    %s

    to:
    %s
    """ % (''.join(contents), '%s\n%s' % (len(sessions), '\n'.join(sessions)))
    email = Email(sender = '*****@*****.**'
                , recipients = ['*****@*****.**', '*****@*****.**']
                , subject    = 'PHT Session Flags'
                , body       = body
                , date       = datetime.now()
                )
    emailN = emailNotifier(smtp = 'smtp.gb.nrao.edu')
    emailN.Send(email)
Пример #3
0
 def setUp(self):
     super(TestEmailNotifier, self).setUp()
     self.notifier = emailNotifier()