#NEWLINE# def __init__( self , reactor , **options ) : #NEWLINE# #INDENT# 'Initialize alert.' #NEWLINE# self . reactor = reactor #NEWLINE# self . options = options #NEWLINE# self . client = hc . AsyncHTTPClient ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . configure ( ** options ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOGGER . exception ( e ) #NEWLINE# raise ValueError ( ( 'Invalid alert configuration: %s' % e ) ) #NEWLINE# #UNINDENT# self . waiting = False #NEWLINE# self . state = { #NEWLINE# #INDENT# None : 'normal' , #NEWLINE# 'waiting' : 'normal' , #NEWLINE# 'loading' : 'normal' , #NEWLINE# #UNINDENT# } #NEWLINE# self . history = defaultdict ( ( lambda : sliceable_deque ( [ ] , self . history_size ) ) ) #NEWLINE# LOGGER . info ( "Alert '%s': has inited" , self )