View Single Post
Old 12-01-2010, 01:44 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by weebl View Post
I am working on a recipe for the Poughkeepsie Journal and I would like to replace a masthead. I am a new at this and the method I tried is not working.
This is a recipe question and really ought to be in the recipe subforum, but ....

Quote:
I've tried the following:
Code:
    def print_version(self, url):
          return url.replace('http://www.poughkeepsiejournal.com', 'http://www.poughkeepsiejournal.com/print')
          return url.replace('http://www.poughkeepsiejournal.com/graphics/mastlogo.gif','http://www.poughkeepsiejournal.com/graphics/branding.gif')
The portion that is not working is replacing the mastlogo.gif with the branding.gif.

Thanks for any help
You can't have two returns above. Delete the one that reads:
Code:
          return url.replace('http://www.poughkeepsiejournal.com/graphics/mastlogo.gif','http://www.poughkeepsiejournal.com/graphics/branding.gif')
Add your masthead to the main code (outside print_version) as follows:
Code:
    masthead_url          = 'http://www.poughkeepsiejournal.com/graphics/branding.gif'

Last edited by Starson17; 12-01-2010 at 01:49 PM.
Starson17 is offline   Reply With Quote