예제 #1
0
def chat_receive(window_info, content=''):
    matcher = re.match('^@([\w\-_]+).*', content)
    if matcher:
        dest = 'chat-%s' % matcher.group(1)
    else:
        dest = BROADCAST
    scall(window_info, 'demo.chat.send', to=[WINDOW, dest], content=content)
예제 #2
0
def print_sig2(window_info, content=''):
    scall(window_info,
          'notify',
          to=[BROADCAST, SERVER],
          content="Server notification [%r]" % content,
          level='warning',
          timeout=2,
          style='notification')
예제 #3
0
def slow_signal(window_info, content=''):
    logger.warn('wait for 10 seconds…')
    time.sleep(10)
    logger.warn('10 seconds: done.')
    scall(window_info,
          'demo.print_sig2',
          to=[BROADCAST, SERVER],
          content='slow result')
예제 #4
0
def print_sig1(window_info, content=''):
    logger.debug('Debug log message [%r]' % content)
    logger.info('Debug info message [%r]' % content)
    logger.warn('Debug warn message [%r]' % content)
    logger.error('Debug error message [%r]' % content)
    scall(window_info,
          'demo.print_sig2',
          to=[BROADCAST, SERVER],
          content=content)
예제 #5
0
def check_websockets(window_info):
    logger.info('websocket OK')
    scall(window_info, 'ed.monitoring.checked_ws', to=[WINDOW])