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 04-06-2025, 12:54 PM   #1471
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
Second one worked.

What would I use specifically for the first one? I wasn't sure if it'd be if globals(_caller) inlist 'Cleanup: Kobo, Add Purchase Information' or something else.
Yes, supposing these are the exact names of the calling chains. If the names of the chains are subject to change, you could do it in every calling chain, by using the Chain Variables action to define a variable (e.g. update = skip), and in the chain caller action, tick the option to pass variables to the called chain.

Note: Variable names starting with underscore are not passed to the called chain.
capink is offline   Reply With Quote
Old 04-06-2025, 02:41 PM   #1472
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
I created an action chain to collect some data.
Haha, I'm still mulling over the school library project. I have this, and it copies the data to the column, but I get this error: User: 2112 | Loan: March 29, 2025 | Return: BAD DATE

Code:
program:
user = field('#user');
loan = format_date(field('#loandate'), 'dd MMM yyyy');

dev = field('#return');
if dev == '' then
return = 'no date'
else
return = format_date(dev, 'dd MMM yyyy')
fi;

'User: ' & user & ' | Loan: ' & loan & ' | Return: ' & return
User field: Text
loandate: date
return: date
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	68
Size:	122.5 KB
ID:	214906  
dunhill is offline   Reply With Quote
Old 04-06-2025, 03:49 PM   #1473
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 dunhill View Post
I created an action chain to collect some data.
Haha, I'm still mulling over the school library project. I have this, and it copies the data to the column, but I get this error: User: 2112 | Loan: March 29, 2025 | Return: BAD DATE
Spoiler:

Code:
program:
user = field('#user');
loan = format_date(field('#loandate'), 'dd MMM yyyy');

dev = field('#return');
if dev == '' then
return = 'no date'
else
return = format_date(dev, 'dd MMM yyyy')
fi;

'User: ' & user & ' | Loan: ' & loan & ' | Return: ' & return
User field: Text
loandate: date
return: date
Does it happen for any book? Does it work for books with no return date?
Terisa de morgan is offline   Reply With Quote
Old 04-06-2025, 04:21 PM   #1474
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,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by dunhill View Post
I created an action chain to collect some data.
Haha, I'm still mulling over the school library project. I have this, and it copies the data to the column, but I get this error: User: 2112 | Loan: March 29, 2025 | Return: BAD DATE

Code:
program:
user = field('#user');
loan = format_date(field('#loandate'), 'dd MMM yyyy');

dev = field('#return');
if dev == '' then
return = 'no date'
else
return = format_date(dev, 'dd MMM yyyy')
fi;

'User: ' & user & ' | Loan: ' & loan & ' | Return: ' & return
User field: Text
loandate: date
return: date
You're in Argentina. could it be non-English text in dates?

Last edited by ownedbycats; 04-06-2025 at 04:27 PM.
ownedbycats is online now   Reply With Quote
Old 04-06-2025, 04:34 PM   #1475
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by Terisa de morgan View Post
Does it happen for any book? Does it work for books with no return date?
Following your message, I tried it and it worked fine in one, but they are all loaded the same way.
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	51
Size:	52.7 KB
ID:	214907  
dunhill is offline   Reply With Quote
Old 04-06-2025, 04:37 PM   #1476
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
You're in Argentina. could it be non-English text in dates?
So, basically, this:

Code:
* ``format_date(val, format_string)`` -- format the value, which must be a date string, using the format_string, returning a string. It is best if the date is in ISO format as using other date formats often causes errors because the actual date value cannot be unambiguously determined. Note that the ``format_date_field()`` function is both faster and more reliable.
Terisa de morgan is offline   Reply With Quote
Old 04-06-2025, 04:37 PM   #1477
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by ownedbycats View Post
You're in Argentina. could it be non-English text in dates?
ahhh possibly, I'll check the iso format, thanks
dunhill is offline   Reply With Quote
Old 04-06-2025, 04:40 PM   #1478
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 dunhill View Post
Following your message, I tried it and it worked fine in one, but they are all loaded the same way.
According to ownedbycats' message, I think if you make this small change:

Code:
dev = field('#return');
if dev == '' then
return = 'no date'
else
return = format_date_field('#return', 'dd MMM yyyy')
fi;
, it could work.
Terisa de morgan is offline   Reply With Quote
Old 04-06-2025, 05:07 PM   #1479
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Now yes! Many thanks to ownedbycats and Terisa de Morgan
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	59
Size:	40.0 KB
ID:	214908  
dunhill is offline   Reply With Quote
Old 04-09-2025, 05:33 PM   #1480
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,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: I have datetime formatted as MMM d yyyy. How do I set a predefined date with specific time?
ownedbycats is online now   Reply With Quote
Old 04-09-2025, 05:43 PM   #1481
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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Question: I have datetime formatted as MMM d yyyy. How do I set a predefined date with specific time?
The easiest is to enter the date & time in ISO format.
Code:
program:
	d = "20250421T13:42:01";
	'The date and time are ' & format_date(d, "MMM d yyyy hh:mm:ss ap")
produces
Code:
The date and time are Apr 21 2025 01:42:01 pm
chaley is offline   Reply With Quote
Old 04-09-2025, 05:50 PM   #1482
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,998
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thanks. Will set on local timezone, or UTC?
ownedbycats is online now   Reply With Quote
Old 04-09-2025, 06:03 PM   #1483
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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Thanks. Will set on local timezone, or UTC?
It is local time (actually, time naive). Example:
Code:
program:
	d = "20250421T13:42:01";
	'The date and time are ' & format_date(d, "iso")
produces the following, which is British Summer Time (+1) not UTC.
Code:
The date and time are 2025-04-21T13:42:01+01:00
This date specifies UTC.
Code:
program:
	d = "20250421T13:42:01Z";
	'The date and time are ' & format_date(d, "iso")
and returns a time one hour later (UTC).
Code:
The date and time are 2025-04-21T14:42:01+01:00
chaley is offline   Reply With Quote
Old 04-11-2025, 08:02 AM   #1484
tkshorty
Member
tkshorty began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2024
Device: Koba Aura
Hi,

I have no experience with python, and I am looking for a module, that I can import as an event, that triggers every time you send an ebook to the device.
Secondly also one for when you remove a book from the device.

Target is, to automatically add / remove a tag (currentlyReading) from the books on the corresponding action.

I am currently using a workaround, where I made a chain for send/del, which I can manually select instaed of the normal buttons.

thanks in advance for any help.
tkshorty is offline   Reply With Quote
Old 04-11-2025, 01:29 PM   #1485
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Found an issue when using Spanish as UI language:

The View (open book) action gives "Menu entry: View (plugin_name: View) cannot be found"

Click image for larger version

Name:	tr1 MWSnap 2025-04-11, 14_04_53.jpg
Views:	86
Size:	48.0 KB
ID:	215000

I've only recently started looking at how translation works in Calibre plugins, but I guess that would be a missing translation in es.po from:
Code:
#: /__w/calibre/calibre/src/calibre/gui2/actions/view.py:51
msgid "View"
msgstr "Mostrar"
Upon changing UI to Spanish, the View action will lose selection state:

Click image for larger version

Name:	tr2 MWSnap 2025-04-11, 14_03_59.png
Views:	83
Size:	445.6 KB
ID:	214999
Comfy.n 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 10:25 PM.


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