Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-15-2021, 03:21 PM   #1
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
save as template

Good day,

Tried to save on Android Tablet with template
{series:lookup(.,#aa,#bb}

but got an error
AttributeError:'TemplateDialog' object has no attribute 'mi'

Please help
ajean4 is offline   Reply With Quote
Old 04-15-2021, 03:58 PM   #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,852
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
It would help if you provided more information:
  • What is shown if you click "Show details?"
  • What version of calibre are you running?
  • On what operating system?
  • What are #aa and #bb?
  • Your copy of the template is missing a closing ')'. Is that a copy/paste error?
Question: that lookup call says to use the contents of #aa if there is a series, otherwise use the contents of #bb. Is that what you meant?
chaley is offline   Reply With Quote
Advert
Old 04-15-2021, 04:02 PM   #3
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
save as template

Yes chaley,

column #aa
{series:shorten(4,.,4)} {series_index:0>5.2f|| . }{author_sort:.4} - {title} - {author}

column #bb
{title} - {author}

Thanks,
ajean4 is offline   Reply With Quote
Old 04-15-2021, 04:03 PM   #4
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,852
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ajean4 View Post
Yes chaley,

column #aa
{series:shorten(4,.,4)} {series_index:0>5.2f|| . }{author_sort:.4} - {title} - {author}

column #bb
{title} - {author}

Thanks,
Please answer the rest of the questions.

Also, are you using the template editor dialog when you see that message?
chaley is offline   Reply With Quote
Old 04-15-2021, 04:04 PM   #5
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
Calibre version is 5.14.0
Linux
ajean4 is offline   Reply With Quote
Advert
Old 04-15-2021, 04:05 PM   #6
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,852
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ajean4 View Post
Calibre version is 5.14.0
Linux
What is shown if you click "Show details?" on the error message?
chaley is offline   Reply With Quote
Old 04-15-2021, 04:06 PM   #7
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,852
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
And is the calibre installation from calibre-ebook.com, or are you installing a package from your linux repo?
chaley is offline   Reply With Quote
Old 04-15-2021, 04:08 PM   #8
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
In the template editor it shows
EXCEPTION: format: type b requires an integer value, got Series
ajean4 is offline   Reply With Quote
Old 04-15-2021, 04:09 PM   #9
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
The template editor shows
EXCEPTION: format: type b requires an integer value, got Series

and it is the calibre ebook website installation...
ajean4 is offline   Reply With Quote
Old 04-15-2021, 04:11 PM   #10
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
It is calibre 5.14.00 and installation is done from the script at calibre-ebook.com

the template editor error is
EXCEPTION: format: type b requires an integer value, got Series
ajean4 is offline   Reply With Quote
Old 04-15-2021, 04:13 PM   #11
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,852
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Never mind. I was able to reproduce what you are seeing. It happens in base 5.14 if you right-click on the template line to open the template editor. The Show Details button shows something like
Code:
calibre, version 5.14.0
ERROR: Unhandled exception: <b>AttributeError</b>:'TemplateDialog' object has no attribute 'mi'
[...]
Python 3.8.5
[...]
Interface language: None
Traceback (most recent call last):
  File "calibre\gui2\preferences\save_template.py", line 54, in do_open_editor
  File "calibre\gui2\dialogs\template_dialog.py", line 313, in __init__
AttributeError: 'TemplateDialog' object has no attribute 'mi'
The problem is fixed (for me) in the next calibre release.
chaley is offline   Reply With Quote
Old 04-15-2021, 04:13 PM   #12
ajean4
Member
ajean4 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2016
Device: Kobo Aura HD
it is the script from calibre-ebook webpage

and the edit template shows
EXCEPTION: format: type b requires an integer value, got Series
ajean4 is offline   Reply With Quote
Old 04-15-2021, 04:32 PM   #13
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,852
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ajean4 View Post
it is the script from calibre-ebook webpage

and the edit template shows
EXCEPTION: format: type b requires an integer value, got Series
That happens because of the missing right parenthesis before the '}' character. Try
Code:
{series:lookup(.,#aa,#bb)}
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help - Save to Disk template Gallips Calibre 8 06-28-2016 01:46 PM
Save Template Help Maverynthia Library Management 10 05-19-2014 12:37 PM
Save to Device template HFC3 Library Management 6 07-08-2013 11:48 AM
Save Template question ltwally Library Management 4 04-11-2013 06:15 PM
A little help with a save template...? Belfaborac Library Management 2 02-04-2011 09:47 PM


All times are GMT -4. The time now is 11:17 AM.


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