Thread: web2lrf
View Single Post
Old 12-03-2007, 05:42 PM   #103
StDo
Translating Calibre...
StDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with others
 
StDo's Avatar
 
Posts: 657
Karma: 2902
Join Date: Aug 2007
Location: ER.de
Device: [PRS-500], PB360
Quote:
Originally Posted by kovidgoyal View Post
Code:
def print_version(self,url):
    tokens = url.split(',') 
    tokens[-2:-1] = ['druck-']
    return ','.join(tokens)
Kovid,
that snippet you gave me replaces the numbers between the last comma and the second last comma with "druck-". But the numbers there should remain and "druck-" should be added in front of the numbers and after the second last comma.

The original link:
Code:
http://www.spiegel.de/panorama/justiz/0,1518,521183,00.html
should be
Code:
http://www.spiegel.de/panorama/justiz/0,1518,druck-521183,00.html
and not (as it will be done with the snippet above):
Code:
http://www.spiegel.de/panorama/justiz/0,1518,druck-,00.html
Thanks for thinking and coding.
StDo is offline   Reply With Quote