![]() |
#871 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
In the Calibre 6 beta, the condition evaluator isn't working, at least for connected_device_name('main').
This screenshot was taken with my Kobo Libra H2O plugged in, and it returns that in the standard template tester. |
![]() |
![]() |
![]() |
#872 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
If you run the beta from source then get Kovid's latest changes. The fix he made for updating in the template tester will also affect this. Alternatively try his test: check and uncheck the bookmarks box.
|
![]() |
![]() |
![]() |
#873 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
More specifically, here's the issue I had:
I have a 'Remove Book from Device' chain*, mostly for when I finish an Overdrive book. It first clears some Kobo-related columns and then adds the book to a 'Remove from Device' reading list. Then, if my device is connected, it immediately syncs the list. However, on 5.99, it doesn't sync the list after upgrading to the beta. This is because the conditional is checking for 'Kobo Libra H2O' and the template is returning a null value. Will the breakpoints thing help with that? I'd run from source but I haven't figured out how to switch to the qt6 branch in Sourcetree. * I'd attach it, but the export is throwing a AttributeError: type object 'QFileDialog' has no attribute 'AnyFile' error. Last edited by ownedbycats; 06-28-2022 at 04:18 PM. |
![]() |
![]() |
![]() |
#874 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Got the qt6 branch running from source.
This time, 'Kobo Libra H2O' does appear under template value in the condition evaulator. Unfortunately, it still fails and doesn't sync. It works if I remove the condition. Last edited by ownedbycats; 06-28-2022 at 04:37 PM. |
![]() |
![]() |
![]() |
#875 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I made this very simple chain (sorry about the images):
The chain: The chain condition: The action: It works. The condition succeeds when I am connected to the folder device. It also worked when I put that condition on the action, not the chain. You might consider putting the x= and the print() into your condition. When running in debug mode you will see what connected_device_name() returns in your case. |
![]() |
![]() |
![]() |
#876 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I did one test with the chain you provided. It works if the condition is attached to the entire chain (formulas dialog pops up).
However, it fails if I attach the condition to the individual action. |
![]() |
![]() |
![]() |
#877 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
Action Chains: Starting chain: foo Action chains: formulas: running on_templates_update() ['Folder Device Custom'] Action Chains: foo: starting action No. 1: Formulas Action chains: formulas: running on_templates_update() Action chains: formulas: running on_templates_update() |
|
![]() |
![]() |
![]() |
#878 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Screen images:
|
![]() |
![]() |
![]() |
#879 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I tested with the formulas action again, and it worked this time -- output looks like yours. Confusing.
Since I finished another Overdrive book, I decided to run my 'remove from device' chain in debug. Here's the actions: Action 1: Prompt for confirmation Action 2: Chain caller ('Clear Kobo fields') Action 3: Add to 'Remove from Device' list Action 4: Sync reading list The last action, which has the Kobo Libra H2O condition, never ran. Code:
Action Chains: Remove from Device: starting action No. 1: Prompt for Confirmation Action Chains: Remove from Device: starting action No. 2: Chain Caller Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: Cleanup: Clear Kobo fields Last Modified Plugin: Hibernation mode is already on. Action Chains: Cleanup: Clear Kobo fields: starting action No. 1: Single Field Edit Action Chains: Cleanup: Clear Kobo fields: starting action No. 2: Single Field Edit Action Chains: Cleanup: Clear Kobo fields: starting action No. 3: Single Field Edit Action Chains: Cleanup: Clear Kobo fields: starting action No. 4: Single Field Edit Last Modified Plugin: Some hibernation jobs still running. Not exiting. Action Chains: Is db modified by chain: True Job Spy: self.gui.tags_view.recount() is enhanced for showing icons of user category child values... Action Chains: chain (Cleanup: Clear Kobo fields) finished in: 0:00:02.764299 Action Chains: Remove from Device: starting action No. 3: Calibre Actions Action Chains: Calibre Actions: paths > ['Reading List', 'Add to list', 'Add to list: Remove from Device'] Action Chains: Calibre Actions: Found action: Remove from Device Action Chains: Calibre Actions: Finishing run action Action chains: formulas: running on_templates_update() Action Chains: Remove from Device: starting action No. 4: Calibre Actions Action Chains: Calibre Actions: paths > ['Reading List', 'Sync Now'] Action Chains: Calibre Actions: Found action: Sync Now Action Chains: Calibre Actions: Finishing run action Last Modified Plugin: Exiting hibernation mode. Last Modified Plugin: Update column (#lastmodified) for book_ids: {7345} (Hibernation cache) Action Chains: Is db modified by chain: True Job Spy: self.gui.tags_view.recount() is enhanced for showing icons of user category child values... Action Chains: chain (Remove from Device) finished in: 0:00:11.407715 |
![]() |
![]() |
![]() |
#880 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I am running with up-to-date beta (Qt6) source and the latest released versions of Action Chains and Reading List. I made a chain that does a reading list sync if the Folder Device is connected. The chain is simple, one action with:
Here is what happens if the condition fails (the device is not connected): Code:
Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: ReadingList Action chains: formulas: running on_templates_update() Action Chains: ReadingList: Conditions are not met for action No. 1 (Calibre Actions) Action Chains: Is db modified by chain: False Action Chains: chain (ReadingList) finished in: 0:00:00.025961 Here is what I see if the device is connected: Code:
Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: ReadingList Action chains: formulas: running on_templates_update() Action Chains: ReadingList: starting action No. 1: Calibre Actions Action Chains: Calibre Actions: paths > ['Reading List', 'Sync Now'] Action Chains: Calibre Actions: Found action: Sync Now READING LIST: Sync Now - force_sync= True Action Chains: Calibre Actions: Finishing run action Action Chains: Is db modified by chain: False Action Chains: chain (ReadingList) finished in: 0:00:00.029105 It seems that your problem is something in Reading List, or something in the environment that causes problems when Action Chains runs the sync. What happens if you do a simple chain like mine? |
|
![]() |
![]() |
![]() |
#881 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
I uploaded an updated version of the plugin that should fix this problem. You can find it in the first post, or wait until the update is announced by calibre. Make sure the action is not disabled (greyed out) in the reading list plugin. I added a debug statement to check for this in the updated version. |
|
![]() |
![]() |
![]() |
#882 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
The simple chain worked.
I noticed one thing: with a book on the list, the menu option changed to 'Sync Now (#)', where # is the number of books ready to sync. I'm not sure if that would cause it to break with a conditional (and it worked before in 5.44, so...) EDIT: Another quick test: I set a simple chain to open the reading list options panel when the Kobo Libra H2O connected. This works as expected. Then I went to set it to 'View To Be Read List (#)' and... the option wasn't actually available as a Calibre action? Last edited by ownedbycats; 06-29-2022 at 01:05 PM. |
![]() |
![]() |
![]() |
#883 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#884 |
Leftutti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
AttributeError after Check Library
After clicking check library I get this error. Then I click ok and the check goes on.
Today I imported a new action chain, maybe it's because of that? Code:
calibre, version 5.44.0 ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'library_path' calibre 5.44 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 49, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 49, 0) && Action Chains (1, 17, 0) && BOL_DE (0, 9, 2) && Clipboard Search (1, 3, 2) && Count Pages (1, 11, 2) && DNB_DE (3, 1, 7) && EpubMerge (2, 13, 0) && Extract ISBN (1, 5, 0) && Fantastic Fiction (1, 5, 1) && Favourites Menu (1, 1, 0) && Find Duplicates (1, 9, 5) && Goodreads (1, 5, 3) && Goodreads Sync (1, 15, 1) && Import List (1, 8, 3) && KFX metadata reader (from KFX Input) (1, 49, 0) && KFX Input (1, 49, 0) && Set KFX metadata (from KFX Output) (1, 63, 0) && KFX Output (1, 63, 0) && Kindle hi-res covers (0, 5, 0) && KindleUnpack - The Plugin (0, 83, 1) && Last Modified (0, 8, 2) && Manage Series (1, 3, 0) && Modify ePub (1, 7, 3) && Quality Check (1, 12, 0) && Quick Preferences (1, 5, 0) && Reading List (1, 11, 0) && Search The Internet (1, 8, 1) && View Manager (1, 8, 0) && Walk Search History (1, 3, 2) Traceback (most recent call last): File "calibre_plugins.action_chains.events.library_about_to_change", line 31, in _on_library_about_to_change AttributeError: 'NoneType' object has no attribute 'library_path' |
![]() |
![]() |
![]() |
#885 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
It is definitely in Action Chains. Whether it is triggered or not by the chain you imported I can't say.
FYI: in the library_about_to_change event the old database can be None, which it probably is when check library is used because there isn't a previous database. That is why you are getting the exception. You should be able to avoid it by disabling any actions that depend on that event. You should post this in the Action Chains thread. EDIT: I will move it there. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 PM |
Action Chains Resources | capink | Plugins | 77 | 06-16-2025 12:45 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |