View Single Post
Old 08-22-2011, 05:27 PM   #99
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,732
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Thanks but that doesn't work either I'm afraid. All very frustrating for something that should be so freaking simple!

I have a template url which could be something like:
Code:
http://www.google.de/#sclient=psy&q=%22{author}%22+%22{title}%22
And I have data which I want to be substituted into those {xxx} tags. My original implementation just substituted in the "quoted" values (after any unicode encoding), so straight away I had the final string ready to just pass to a web-browser.

I think it is the open_url function requiring a QUrl which is making this all go pear shaped, unlike webbrowser.open() call which took the string directly.

To keep as a string and delay quoting, that would imply my starting point is something like this:
Code:
http://www.google.de/#sclient=psy&q="{author}"+"{title}"
However applying the quote function to the entire string results in a string that has all sorts of characters encoded - like the : after http etc etc. So that isn't going to work.
kiwidude is offline   Reply With Quote