View Single Post
Old 03-02-2025, 07:04 AM   #17
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,656
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
Where did you put that template? If you put it in a custom column definition or in the Kobo driver, it sort-of confirms what I thought -- that there is a problem with stored user template functions and possibly stored templates, in this context. Managing their availability to threads and processes is a nightmare. Python and GPM templates are stored as the template text and compiled as needed so they are by definition avaiiable when needed.
Exactly, it's in the custom column definition. And yes, I can see how it can be a nightmare.

Quote:
Originally Posted by chaley View Post
Another thought -- too late given you have a solution. Were the books with the problem marked as "On Device" when the reader was connected? If not then the problem could have been historical because the value in the Kobo database would be used. The fact that changing the template fixed it argues against this theory. The fact that you weren't getting exceptions in the log argues for it.
Yes, they are marked as "On Device", and no, I've not changed the template, I've created a new column with the new template and used it I prefer not touching something that is working at some reader and use something new. I'll remove the "wrong" column after some time.

Quote:
Originally Posted by chaley View Post
I know you prefer python over the template language. This python template should do the same thing as the GPM template above.
Code:
python:
def evaluate(book, context):
	pref="#C:"
	new_list = [pref + v for v in book.get('#des', [])]
	return ', '.join(new_list)
Thank you very much for this template, really. It's not that I prefer it, it's that I'm more comfortable and faster doing it. The templates I've shown is really copied from the examples in the template language manual (I don't read the whole manual but use it when necessary ), so it's find for me. I've used too many programming languages in my life to stick only to one, really.

And thanks a lot for checking this problem, I know it's not normal and there are a lot of users, so I really appreciate you check it.
Terisa de morgan is offline   Reply With Quote