<s> class BaseSchedulerMiddleware ( object ) : <EOL> def __init__ ( self , crawler ) : <EOL> self . crawler = crawler <EOL> @ classmethod <EOL> def from_crawler ( cls , crawler ) : <EOL> return cls ( crawler ) <EOL> @ property <EOL> def scheduler ( self ) : <EOL> return self . crawler . engine . slot . scheduler <EOL> class SchedulerSpiderMiddleware ( BaseSchedulerMiddleware ) : <EOL> def process_spider_output ( self , response , result , spider ) : <EOL> return self . scheduler . process_spider_output ( response , result , spider ) <EOL> class SchedulerDownloaderMiddleware ( BaseSchedulerMiddleware ) : <EOL> def process_exception ( self , request , exception , spider ) : <EOL> return self . scheduler . process_exception ( request , exception , spider ) </s>
