Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

""" 

Item pipeline 

 

See documentation in docs/item-pipeline.rst 

""" 

 

from scrapy.middleware import MiddlewareManager 

 

class ItemPipelineManager(MiddlewareManager): 

 

    component_name = 'item pipeline' 

 

    @classmethod 

    def _get_mwlist_from_settings(cls, settings): 

        return settings.getlist('ITEM_PIPELINES') 

 

    def _add_middleware(self, pipe): 

        super(ItemPipelineManager, self)._add_middleware(pipe) 

        if hasattr(pipe, 'process_item'): 

            self.methods['process_item'].append(pipe.process_item) 

 

    def process_item(self, item, spider): 

        return self._process_chain('process_item', item, spider)