![]() |
#376 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#377 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Of course, me not seeing anything isn't definitive. ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#378 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#379 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#380 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I can "fix" this in calibre but that will change the information available to every client of the device_connection_changed signal. I am willing to do this if Kovid agrees. Action chains can fix this by using a QTimer.singleShot(0, ...) to run anything associated with a disconnect event. |
|
![]() |
![]() |
Advert | |
|
![]() |
#381 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#382 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#383 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Still showing the device name. Should I update anything beside sr/calibre/gui2/device.py?
|
![]() |
![]() |
![]() |
#384 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
It works for me. Here is the log: Code:
Action Chains: Starting event: Device Disconnected calling method (init_cache) of obj (selection_count) ('template', '') calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: Test bool Action Chains: Test bool: starting action No. 1: Single Field Edit ('template', '') Action Chains: chain (Test bool) finished in: 0:00:00.075093 Action Chains: event (Device Disconnected) finished in: 0.07902860641479492 Code:
{ "action_name": "Single Field Edit", "action_settings": { "col_name": "#mybool", "template": "program: \n\tprint('template', connected_device_name('main'));\n\t'Yes'", "value_type": "template" }, "comment": "" } Code:
Action Chains: Starting event: Device Connected calling method (init_cache) of obj (selection_count) ('template', 'Folder Device') calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: Test bool Action Chains: Test bool: starting action No. 1: Single Field Edit ('template', 'Folder Device') Action Chains: chain (Test bool) finished in: 0:00:00.040365 Action Chains: event (Device Connected) finished in: 0.04210329055786133 Last edited by chaley; 03-15-2021 at 09:54 AM. |
|
![]() |
![]() |
![]() |
#385 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
It works for me if I connect to Folder Device. Does not work when I use my kindle:
Code:
Action Chains: Starting event: Device Disconnected calling method (init_cache) of obj (selection_count) calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: test device disconnect Action Chains: test device disconnect: starting action No. 1: Chain Variables ('device_info: ', 'Amazon Kindle') Action Chains: chain (test device disconnect) finished in: 0:00:00.930646 Action Chains: event (Device Disconnected) finished in: 1.0228612422943115 Code:
{ "ActionsChainMenus": { "Menus": [ { "active": true, "chain_settings": { "chain_links": [ { "action_name": "Chain Variables", "action_settings": { "chain_vars": [ { "iterate": false, "name": "new_var", "value": "program:\nprint('device_info: ', connected_device_name('main'))" } ] }, "comment": "" } ], "refresh_gui": true }, "image": "", "menuText": "test device disconnect", "subMenu": "" } ] }, "schemaVersion": 1.3 } |
![]() |
![]() |
![]() |
#386 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Could you try this version of device.py? Thanks.
It turns out that using "eject" is rather different from unplugging the device. In the "eject" case calibre pretends that the device went away. It doesn't really go away until it is physically disconnected. This version of device.py deals with that case. |
![]() |
![]() |
![]() |
#387 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I can confirm that this one works.
![]() |
![]() |
![]() |
![]() |
#388 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The new version of device.py is now in calibre source.
EDIT: I tested it on:
Last edited by chaley; 03-15-2021 at 11:52 AM. |
![]() |
![]() |
![]() |
#389 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
API
Action chains provides an experimental API that enables other plugins to communicate with it. At this point it is unstable and is meant mainly for testing. Two main things that can be done are:
Last edited by capink; 07-01-2024 at 11:36 PM. |
![]() |
![]() |
![]() |
#390 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Version 1.4.0
Version 1.3.2
Version 1.3.3
Version 1.4.0
The API changes are experimental at this stage. For those interested you can read more about them here. The newly added action is a modified version of an action that was posted in this thread as a custom. It gives the user the ability to construct calibre search using calibre template language. The only modificatoin is the addition of a checkbox to enable selecting the books resulting from the search. This action could not be added to the selection modifier, because the selection modifier has to validate the search when the user configures the action to make sure it will always return a valid search. This is done because if a user combines a search with the option to select all books in current view, and the search turns out to invalid, all books in current view (the whole library most likely) will be selected and acted upon by subsequent actions. Since the new action constructs a search from a template it cannot be verified at configure time. It was also dangerous to combine the old iteration of the action (the one posted previously as a custom action) with the selection modifier to select all books in current view because it would have led to the same problem outlined above. So the modification to this action, is to make it able to select the books resulting from the search, but only if the search yields valid results, otherwise no books will be selected. @Terisa De Morgan: The behavior of the plugin changes in that if you have an action that operates on a field that does not exist in the current library, the chain will fail to validate and will not run even if you set a condition using field_exists(). You have to take one additional step, by explicitly setting the newly introduced option in the condition evaluator to not validate the action whenever the conditions are not met. This change was necessary because the old behavior did lead to some strange and inconsistent behavior. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |