07-18-2022, 06:10 AM | #91 | |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
07-26-2022, 12:52 PM | #92 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
switch() function performance / compound icons
23 July 2022 (in calibre 6.2.1):
Last edited by chaley; 08-01-2022 at 11:23 AM. |
Advert | |
|
09-14-2022, 06:04 AM | #93 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
New function strcmpcase
14 Sept 2022 (in calibre 6.5.0)
Last edited by chaley; 09-16-2022 at 11:12 AM. |
09-16-2022, 11:15 AM | #94 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
New template function to_hex()
16 Sept 2022 (in calibre 6.5.0)
|
10-12-2022, 06:52 AM | #95 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
New Python Template Mode
12 Oct 2022 (in calibre 6.7.0)
Last edited by chaley; 11-01-2022 at 10:06 AM. |
Advert | |
|
11-01-2022, 11:26 AM | #96 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
29 Oct 2022 (in calibre 6.8.0)
Last edited by chaley; 11-15-2022 at 01:23 PM. |
11-15-2022, 01:47 PM | #97 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
15 Nov 2022 (in calibre 6.9.0)
Last edited by chaley; 12-29-2022 at 03:14 PM. |
01-06-2023, 11:01 AM | #98 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
06 Jan 2023 (in calibre 6.12):
Last edited by chaley; 02-23-2023 at 10:53 AM. |
04-09-2023, 05:57 PM | #99 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
08 Apr 2023 (in calibre 6.15)
|
04-24-2023, 11:41 AM | #100 |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
New extra book data functions
24 Apr 2023 (in calibre 6.17)
New template functions:
Last edited by chaley; 04-27-2023 at 10:50 AM. |
04-27-2023, 06:29 AM | #101 |
null operator (he/him)
Posts: 20,952
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I want to show an icon if the data folder contains a file named todo.???? (might be ToDo.txt, TODO.EML, todo.stky, etc).
Something like extra_file_exists("todo.*") might be useful. BR |
04-27-2023, 06:37 AM | #102 | |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: files = extra_file_names(':'); in_list(files, ':', 'todo\..*', 'Yes', '') Last edited by chaley; 04-27-2023 at 06:40 AM. |
|
04-27-2023, 07:57 AM | #103 |
Custom User Title
Posts: 9,344
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Would it make sense to include an explicit extra_file_count()? I think its currently possible with existing list functions (forgot exactly).
|
04-27-2023, 08:01 AM | #104 | |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: list_count(extra_file_names(':'), ':') Code:
python: def evaluate(book, context): from calibre.gui2.ui import get_gui extra_files = get_gui().current_db.new_api.list_extra_files(book.id, use_cache=True) return str(len(extra_files)) if extra_files else '' Last edited by chaley; 04-27-2023 at 08:08 AM. |
|
04-27-2023, 09:24 AM | #105 | |
Grand Sorcerer
Posts: 11,951
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
To get "Yes" with the changed version you would do Code:
program: if has_extra_files() then 'Yes' fi |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A few questions... (template language, mainly) | Clem2605 | Library Management | 2 | 12-30-2020 03:25 AM |
Template Language | phossler | Calibre | 8 | 01-12-2016 04:37 PM |
Help needed with template language | Mamaijee | Devices | 12 | 02-19-2013 01:52 AM |
Help with template language | Pepin33 | Calibre | 8 | 11-11-2012 08:32 AM |
Template language question | BookJunkieLI | Library Management | 7 | 02-02-2012 06:55 PM |