title: python call class method to reduce duplicate
body: <p>I have two scrapy project has many code duplicate 
  <code>project1.py</code> will crawl whole links
  <code>project2.py</code> will crawl a few links just for test   </p>
  
  <p>I want to modify project2.py for reducing duplicate code  </p>
  
  <p>Here is my code structure:</p>
  
  <p>project1.py </p>
  
  <pre><code>class MySpider(Spider):
  
      name = "get_all"
      start_urls = [""]
  
      def __init__(self,**kwargs):
          dispatcher.connect(self.spider_closed, signals.spider_closed)
          super(MySpider, self).__init__()
  
      def parse(self, response):
          ...
          yield Request(url=url,callback=self.status_info)
  
      def status_info(self, response):
          ... 
          yield Request(url=url,  callback=self.project_info)
  
      def project_info(self, response):
          ...
          yield Request(url=rewards,callback=self.comment_info)
  
      @classmethod
      def comment_info(cls, response):
          yield item 
  
      @classmethod
      def spider_closed(cls, spider):
          ...
  </code></pre>
  
  <p>project2.py </p>
  
  <pre><code>class MySpider2(Spider):   
      name = "get_uni"
      start_urls = [""]
  
      def __init__(self,**kwargs):
          dispatcher.connect(self.spider_closed, signals.spider_closed)
          super(MySpider2, self).__init__()
  
      def parse(self, response):
          ... 
          yield Request(url=url, callback=self.project_info)
  
      def project_info(self, response):
          yield Request(url=rewards,callback=self.comment_info)
  
      @classmethod
      def comment_info(cls, response):
          ...
          yield item
  
      @classmethod
      def spider_closed(cls, spider):
          ... 
  </code></pre>
  
  <p>I edit my project2 into :</p>
  
  <pre><code>from myproject.spiders.project1 import MySpider
  
  class MySpider2(Spider):   
      name = "get_uni"
      start_urls = [""]
  
      def __init__(self,**kwargs):
          dispatcher.connect(MySpider.spider_closed, signals.spider_closed)
          super(MySpider2, self).__init__()
  
      def parse(self, response):
          ... 
          yield Request(url=url, callback=MySpider.project_info)
  </code></pre>
  
  <p>but get error: </p>
  
  <pre><code>File "/Users/obe/env/lib/python2.7/site-packages/twisted/internet/defer.py", line 588, in _runCallbacks
  current.result = callback(current.result, *args, **kw)
  TypeError: unbound method project_info() must be called with MySpider instance as first argument (got TextResponse instance instead)
  </code></pre>
  
  <p>Where is wrong?
  Please guide me,Thank you</p>