#NEWLINE# @ cli . command ( ) #NEWLINE# @ click . option ( '--processor-cls' , default = 'pyspider.processor.Processor' , callback = load_cls , help = 'Processor class to be used.' ) #NEWLINE# @ click . pass_context #NEWLINE# def processor( ctx , processor_cls , enable_stdout_capture = True ) : #NEWLINE# #INDENT# '\n    Run Processor.\n    ' #NEWLINE# g = ctx . obj #NEWLINE# Processor = load_cls ( None , None , processor_cls ) #NEWLINE# processor = Processor ( projectdb = g . projectdb , inqueue = g . fetcher2processor , status_queue = g . status_queue , newtask_queue = ctx . newtask_queue , result_queue = g . processor2result , enable_stdout_capture = enable_stdout_capture ) #NEWLINE# g . instances . append ( processor ) #NEWLINE# if g . get ( 'testing_mode' ) : #NEWLINE# #INDENT# return processor #NEWLINE# #UNINDENT# processor . run ( )