#NEWLINE# def setup( self , thread_id , **kwargs ) : #NEWLINE# #INDENT# '\n        Setup the worker and read all settings\n        ' #NEWLINE# self . thread_id = thread_id #NEWLINE# if ( 'worker_settings' in kwargs ) : #NEWLINE# #INDENT# if ( self . name in kwargs [ 'worker_settings' ] ) : #NEWLINE# #INDENT# self . settings . update ( kwargs [ 'worker_settings' ] [ self . name ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'all' in kwargs [ 'worker_settings' ] ) : #NEWLINE# #INDENT# self . settings . update ( kwargs [ 'worker_settings' ] [ 'all' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . info ( '{0}# no settings loaded from config' . format ( self . thread_id ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . redis_host = self . settings [ 'redis-host' ] #NEWLINE# self . redis_port = self . settings [ 'redis-port' ] #NEWLINE# self . dumped = 0 #NEWLINE# log . info ( "{0}# Worker '{1}' initiated" . format ( thread_id . thread_id , self . name ) )