Пример #1
0
def checkMessages():
    """
    Verifies if there are available message for the operators.
    If there is at least one unread message, the indicator will change color to red.
    If all messages left are acknowledge, the indicator will be yellow.
    If there are no messages waiting, it will be green.
    """
    import MsgOpUtils
    msgs = MsgOpUtils.getMsg()
    new = 0
    acknowledged = 0
    for msg in msgs:
        if msg[0].find('.ack') == -1:
            new += 1
        else:
            acknowledged += 1
    print '<table width="5%" border="0" cellpadding="2"><tr><td width="40" bgcolor="#cccccc"></td><td>'
    if new > 0:
        print '<table bgcolor="red" border="1" cellpadding="2">'
    elif acknowledged > 0:
        print '<table bgcolor="yellow" border="1" cellpadding="2">'
    else:
        print '<table bgcolor="lightgreen" border="1" cellpadding="2">'
    print '<tr><td><a href="pxMsgOp.py">Operator Messages</a></td></tr></table>'
    print '</td></tr></table>'
Пример #2
0
def checkMessages():
    """
    Verifies if there are available message for the operators.
    If there is at least one unread message, the indicator will change color to red.
    If all messages left are acknowledge, the indicator will be yellow.
    If there are no messages waiting, it will be green.
    """
    import MsgOpUtils
    msgs = MsgOpUtils.getMsg()
    new = 0
    acknowledged = 0
    for msg in msgs:
        if msg[0].find('.ack') == -1:
            new += 1
        else:
            acknowledged += 1
    print '<table width="5%" border="0" cellpadding="2"><tr><td width="40" bgcolor="#cccccc"></td><td>'
    if new > 0:
        print '<table bgcolor="red" border="1" cellpadding="2">'
    elif acknowledged > 0:
        print '<table bgcolor="yellow" border="1" cellpadding="2">'
    else:
        print '<table bgcolor="lightgreen" border="1" cellpadding="2">'
    print '<tr><td><a href="pxMsgOp.py">Operator Messages</a></td></tr></table>'
    print '</td></tr></table>'
Пример #3
0
        else:
            logger.error('Operator Messages: %s could not be deleted' % (header))

print """    </td>
  </tr>
  <tr>
    <td valign="top" align="center" bgcolor="#cccccc">
        <blockquote>
            <font size="6"><b><pre>Available messages:</pre></b></font>
        </blockquote><br>
    </td>
  </tr>
  <tr>
    <td valign="top" bgcolor="#cccccc">
"""
msgs = MsgOpUtils.getMsg()

# We want the new messages to be displayed first
acknowledged = []
new = []
aftn = []
for msg in msgs:
    if msg[0].find('Nuclear') != -1:
        aftn.append(msg) 
    elif msg[0].find('.ack') != -1:
        acknowledged.append(msg)
    else:
        new.append(msg)

acknowledged.sort()
new.sort()
Пример #4
0
            logger.error('Operator Messages: %s could not be deleted' %
                         (header))

print """    </td>
  </tr>
  <tr>
    <td valign="top" align="center" bgcolor="#cccccc">
        <blockquote>
            <font size="6"><b><pre>Available messages:</pre></b></font>
        </blockquote><br>
    </td>
  </tr>
  <tr>
    <td valign="top" bgcolor="#cccccc">
"""
msgs = MsgOpUtils.getMsg()

# We want the new messages to be displayed first
acknowledged = []
new = []
aftn = []
for msg in msgs:
    if msg[0].find('Nuclear') != -1:
        aftn.append(msg)
    elif msg[0].find('.ack') != -1:
        acknowledged.append(msg)
    else:
        new.append(msg)

acknowledged.sort()
new.sort()