View Single Post
Old 11-22-2009, 08:01 AM   #878
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
parse_index() question

I am working on a recipe consisting of a couple of RSS feeds and one webpage that needs custom parsing. Articles from both sources have the same structure, so they all can be parsed with the same preprocess_html()
So I thought to be clever and did something along this pseudo-code
Code:
class MyRecipe(BasicNewsRecipe) :
    INDEX = u'http://example.com'
    feeds = [(u'example', u'http://example.com/rss')]
    
    def parse_index(self) :
        #raise Exception('spam', 'eggs') # This is always raised
        answer = super(MyRecipe, self).parse_index()
        #raise Exception('spam', 'bacon and eggs') # This is never raised, but the feeds _are_  parsed
        
        #  Do my thing with self.INDEX . . .
        
        answer.insert(0, [myTitle, myArticles])
        
        return answer
But this does not work. The call to super.parse_index() never returns, where I expected it to have the same signature.

What am I missing, and is there a workaround?
evanmaastrigt is offline