#NEWLINE# @ task #NEWLINE# def worker( loglevel = 'INFO' , hostname = '%h' , autoreload = False ) : #NEWLINE# #INDENT# ' Runs the Celery worker service ' #NEWLINE# from scrapi.tasks import app #NEWLINE# command = [ 'worker' ] #NEWLINE# if loglevel : #NEWLINE# #INDENT# command . extend ( [ '--loglevel' , loglevel ] ) #NEWLINE# #UNINDENT# if hostname : #NEWLINE# #INDENT# command . extend ( [ '--hostname' , hostname ] ) #NEWLINE# #UNINDENT# if autoreload : #NEWLINE# #INDENT# command . extend ( [ '--autoreload' ] ) #NEWLINE# #UNINDENT# app . worker_main ( command )