View Single Post
Old 09-21-2010, 12:16 AM   #2782
TonytheBookworm
Addict
TonytheBookworm is on a distinguished road
 
TonytheBookworm's Avatar
 
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
Quote:
Originally Posted by bhandarisaurabh View Post
it is giving some type of indentation error
If your actually trying to modify the built in recipe. I do not see why. I testing it on my end and do not see after running it where any of the articles were not in print version. Also, I ran a test with print statements included and I do not see anywhere where the original url is what you stated of being changed. It appears to follow the flow that the original author of the recipe expected and looked for. In other words, kinda hard to fix something that isn't broken. <shrug>

As far as the indents you have to make sure they are spaced out correctly.
Spoiler:

Code:
def print_version(self, url):
        print 'ORG URL IS: ', url
        split1 = url.split("/")
        print 'THE SPLIT IS: ', split1 
        id = len(split1)
        # we want to find the size of the array split 
        # because we know the id will always be in the last index
        
        print_url = ‘http://www.business-standard.com/india/printpage.php?autono=’ + split1[id]+ ‘&tp=’
        return print_url

****notice the return statement is directly under the print_url statement.

Last edited by TonytheBookworm; 09-21-2010 at 12:18 AM.
TonytheBookworm is offline