Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-28-2020, 07:51 AM   #211
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
I am afraid you will have to write the code for that. I don't know much about calibre editor. The plugin was designed to access some calibre interface action —through Calibre Actions— in the main calibre program only.
capink is offline   Reply With Quote
Old 12-28-2020, 08:28 AM   #212
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by capink View Post
I am afraid you will have to write the code for that. I don't know much about calibre editor. The plugin was designed to access some calibre interface action —through Calibre Actions— in the main calibre program only.
Thank you. You have saved me a lot of head scratching and time trying to work out how to get the plugin to do things it is not designed to do.

I have an easy alternate way of doing what I wanted using some third party software, so no biggy.
Thasaidon is offline   Reply With Quote
Old 12-28-2020, 03:16 PM   #213
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Event Manager

The new event manager gives the user the ability to make chains run automatically in response to events. Events can be either builtin or user-defined. See example below for how to write custom events.

The plugin currently ships with these builtin events:
  • Library Changed
  • Location Selected
  • Device Connected
  • Device Disconnected
  • Book List Double Clicked
  • Book List Enter Pressed
  • Calibre Initialized
  • Timer
  • Shutting Down
  • VL Tab Changed


    Quote:
    N.B This timer is activated every 5 minutes (can be configured by: Preferences > Plugins > Action Chains > Customize Plugin) for chains that should do automatic tasks at regular intervals.

This new event manager was made possible by the introduction of the conditions dialog, because running chains in response to events without reining them with conditions would have been impractical. See this post for more on how to set conditions for chains.

Events can pass arguments that are stored in a chain variable called _event_args. Currently only these Events pass arguments:
  • Book List Double Clicked: book_id, column_name
  • Book List Enter Pressed: book_id, column_name
  • VL Tab Changed: current_vl, previous_vl


Here is an example of how to add extra events using the plugin's module editor, you do it by returning the signal associated with the event.

Code:
from calibre_plugins.action_chains.events import ChainEvent

class SearchChanged(ChainEvent):

    # replace with the name of your event
    name = 'Search Changed'

    def get_event_signal(self):
        return self.gui.search.changed
Note1: Be careful with what events you are adding, events that repeat so often (e.g selections changes) are not good candidate for linking to action chains.

Note2: The event manager does not respond to any events that happen when chains or other events are running.

Last edited by capink; 02-26-2025 at 04:37 PM.
capink is offline   Reply With Quote
Old 12-28-2020, 03:23 PM   #214
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Thasaidon View Post
Thank you. You have saved me a lot of head scratching and time trying to work out how to get the plugin to do things it is not designed to do.

I have an easy alternate way of doing what I wanted using some third party software, so no biggy.
If you're on Windows, look into Pulover's Macro Creator.
ownedbycats is online now   Reply With Quote
Old 12-28-2020, 08:13 PM   #215
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by ownedbycats View Post
If you're on Windows, look into Pulover's Macro Creator.
Thank you.

I know about Pulover's Macro Creator and have used it in the past. I have problems with it, although it is very powerful. Also it would be overkill for what I want to do so I am trying out MiniMouse.
Thasaidon is offline   Reply With Quote
Old 12-28-2020, 10:34 PM   #216
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I created a one-action chain to switch to my custom "on device" view in View Manager. I set Events Manager to run it when a device gets connected. It works.

Small typo in the dialog: "Validate chains before runnig..."

Last edited by ownedbycats; 12-28-2020 at 10:37 PM.
ownedbycats is online now   Reply With Quote
Old 12-29-2020, 06:16 AM   #217
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
I created a one-action chain to switch to my custom "on device" view in View Manager. I set Events Manager to run it when a device gets connected. It works.

Small typo in the dialog: "Validate chains before runnig..."
You certainly have a use for every feature
capink is offline   Reply With Quote
Old 12-29-2020, 10:31 AM   #218
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,012
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
How would you set up an event for adding a book.... and how would it handle multiple books imported at once... would this make sense?
compurandom is offline   Reply With Quote
Old 12-29-2020, 10:44 AM   #219
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
You will have to look in calibre code for signals associated with these events, and add them as action chains events.

As for import, if you are using something like Import List plugin, a better approach is to create a chain with Import List as the first action, followed by whatever actions you want after that. This cannot be done for adding books, as the action for adding books starts on a separate thread without blocking the main thread, which does not work with action chains sequential nature. Hence, it was removed.
capink is offline   Reply With Quote
Old 12-29-2020, 04:17 PM   #220
compurandom
Wizard
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 1,012
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
This is not something I'd ever likely use. I just import books with a tag marking them as needing attention and then manually process them. But someone asked a question that this might be a solution for.

Quote:
Originally Posted by capink View Post
This cannot be done for adding books, as the action for adding books starts on a separate thread without blocking the main thread, which does not work with action chains sequential nature.
I'm thinking that if this was to be implemented, it would be something like, wait for everything to settle and then run the chain with all the newly added books marked or selected or something.

Maybe it'd just be easier to run it by hand and rely on the tag that marks newly imported books.
compurandom is offline   Reply With Quote
Old 12-29-2020, 04:23 PM   #221
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,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
This just needs someone to wrap the adding action into a function that calls it and blocks the main thread until all books are added (most a probably there is signal or something that can be used to check using qtimer), and then return control. After that you can select all added books with the selection modifier (books modified by last action).

I am not interested in this myself, so I have not looked on how it could be implemented.
capink is offline   Reply With Quote
Old 12-29-2020, 09:24 PM   #222
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
One thing that would be easy to chain I'd think is adding the same file to multiple book records as long as the file path stayed the same. A bit useless for most situations though—the only use I can think of is to add a dummy.paperbook file to records of physical books.

Last edited by ownedbycats; 12-29-2020 at 10:58 PM.
ownedbycats is online now   Reply With Quote
Old 12-29-2020, 10:56 PM   #223
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Small idea:

I can see several uses for an "add/remove specified amount" to Single Field Edit > Integer-type, e.g. a column tracking how many times the book's been read. Possibly can already done via template though.

I'm not planning anything requiring its use in the near future, but something to consider.

Last edited by ownedbycats; 12-29-2020 at 10:59 PM.
ownedbycats is online now   Reply With Quote
Old 12-30-2020, 03:18 AM   #224
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,636
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 ownedbycats View Post
Small idea:

I can see several uses for an "add/remove specified amount" to Single Field Edit > Integer-type, e.g. a column tracking how many times the book's been read. Possibly can already done via template though.

I'm not planning anything requiring its use in the near future, but something to consider.
Rereads
Terisa de morgan is offline   Reply With Quote
Old 12-30-2020, 11:12 AM   #225
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Issue with version 0.5.2

Until this version everything is fine. I think the screenshot explains it clearly.
Attached Thumbnails
Click image for larger version

Name:	Captura.PNG
Views:	582
Size:	44.7 KB
ID:	184374  
jbacelar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:49 PM.


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