Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-15-2022, 05:36 PM   #61
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
I am able to pass my custom python context. Problem is, I need to be able to pass it to the template dialog as well (like we do with global_vars), otherwise, any helper functions or attributes will fail in the template dialog.

Unfortunately, I didn't have the time to test this before the weekend.
My mistake. I didn't remember that path. I will fix it tomorrow.
chaley is offline   Reply With Quote
Old 10-16-2022, 10:39 AM   #62
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
I am able to pass my custom python context. Problem is, I need to be able to pass it to the template dialog as well (like we do with global_vars), otherwise, any helper functions or attributes will fail in the template dialog.

Unfortunately, I didn't have the time to test this before the weekend.
The fix is in calibre source.
chaley is offline   Reply With Quote
Advert
Old 10-16-2022, 12:10 PM   #63
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
Well, I think my introspection system is stable.
Not sure about my English for the doc.
Go for the pull request.

Also @capink, my system is in fully dynamic and integrates ALL the functions currently loaded in the editor, including the ones specially added by your plugin.
At less, as long as you are in a template editor launched and managed by Action Chaine.
I was the first one surprised and particularly happy of this success.

Edit: Merged in calibre source.
Attached Thumbnails
Click image for larger version

Name:	Capture d’écran 2022-10-16 180037.png
Views:	73
Size:	48.3 KB
ID:	197199  

Last edited by un_pogaz; 10-17-2022 at 11:02 AM.
un_pogaz is offline   Reply With Quote
Old 10-17-2022, 11:10 AM   #64
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
The fix is in calibre source.
It is working as expected. Thanks

Quote:
Originally Posted by un_pogaz View Post
Also @capink, my system is in fully dynamic and integrates ALL the functions currently loaded in the editor, including the ones specially added by your plugin.
At less, as long as you are in a template editor launched and managed by Action Chaine.
I was the first one surprised and particularly happy of this success.
This is a very useful addition. Thanks for your efforts.
capink is offline   Reply With Quote
Old 10-17-2022, 11:12 AM   #65
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@un_pogaz: I am going through formatter.py and the docs, cleaning up comments and messages. Please don't make changes until I am done or we will have a mess of conflicts. Thanks
chaley is offline   Reply With Quote
Advert
Old 10-17-2022, 12:25 PM   #66
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
@un_pogaz: I am going through formatter.py and the docs, cleaning up comments and messages. Please don't make changes until I am done or we will have a mess of conflicts. Thanks
All done. Changes pushed and accepted.
chaley is offline   Reply With Quote
Old 10-24-2022, 12:34 PM   #67
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I added setting breakpoints in python templates to the template tester. When a breakpoint is hit a dialog opens showing the local variables in the current frame. Breakpoints are on source lines and are triggered just before that line executes. They work for the entire template including helper functions.
Attached Thumbnails
Click image for larger version

Name:	Clipboard02.png
Views:	76
Size:	63.0 KB
ID:	197343  
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python functions in database and calibre 5 Terisa de morgan Calibre 7 09-27-2020 02:52 AM
A little help with template functions in a composite column, please! mopkin Library Management 2 11-05-2019 11:07 PM
Using built-in template functions in a custom template function ilovejedd Library Management 4 01-28-2018 12:20 PM
Rules, templates, and functions for column coloring and composed icons readin Library Management 7 08-11-2016 04:41 PM
template: if one of the tag is something... maybe contains or in_list functions fxp33 Calibre 4 07-19-2014 05:18 AM


All times are GMT -4. The time now is 12:59 AM.


MobileRead.com is a privately owned, operated and funded community.