View Single Post
Old 10-17-2011, 08:43 AM   #4
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 520
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
You can get rid of the class variable INDEX and just use an instance variable. Like this:
Code:
    def get_browser(self):
        self.INDEX = 'http://www.economist.com/printedition/'+self.username
        return BasicNewsRecipe.get_browser()

    def get_cover_url(self):
        br = self.browser
        br.open(self.INDEX)
        self.log('Fetching cover for issue: ')
        date = self.username.replace('-', '')
        cover_url =  "http://media.economist.com/sites/default/files/imagecache/print-cover-full/%s_CNA400.jpg" % date
        return cover_url
pietvo is offline   Reply With Quote