Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-04-2015, 08:49 AM   #1
ivanm
e^bored
ivanm began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jun 2010
Device: Kobo Aura HD, BeBook Neo
Syntax for custom lists in programs

I'm trying to add a tag to my books based upon whether it's a graphic novel.

What I'm trying to do is:
Code:
comic_types = ["CBR", "CBZ", "CBT", "CBA", "CB7"];
formats = approximate_formats();

has_comic_formats = list_intersection(comic_types, formats,",");
# etc.
However, the definition of comic_types is obviously wrong (in that I get a "Formatter: failed to scan program. Invalid input ..." error when I try to use it).

Does calibre have support for actual lists, or is it just all operating on Strings (and doing text-munging)?
ivanm is offline   Reply With Quote
Old 01-04-2015, 10:17 AM   #2
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: 11,761
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
By calibre I assume you mean the template language. You are correct, the template language supports strings. A string is converted to a list if the context calls for it. In your example you would use "CBR, CBZ, CBT, CBA, CB7".

If you want to use "real" lists then you can write a custom formatter function in python, which will of course have much better performance than a template language program.
chaley is offline   Reply With Quote
Advert
Old 01-04-2015, 04:30 PM   #3
ivanm
e^bored
ivanm began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jun 2010
Device: Kobo Aura HD, BeBook Neo
That's what I was afraid of. Thanks for confirming for me chaley.
ivanm is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Either/Or Search Syntax? PatNY Library Management 4 09-05-2013 06:15 AM
Help with Syntax please..... Hendrixxxxxxxx Library Management 4 01-31-2013 12:17 AM
syntax tags MMAC Library Management 1 02-29-2012 03:51 PM
Help with plugboard syntax, please Ptarmigan Library Management 3 02-15-2012 05:44 AM
Help with search syntax please. rwelbourn Library Management 3 04-16-2011 02:07 AM


All times are GMT -4. The time now is 08:26 PM.


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