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 11-15-2013, 12:02 AM   #1
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Plugboards equaling null

I need a plugboard that will clear all the tags from any books which I send/save.

All my tags are meant only for sorting using calibre, and I don't need them clogging up the content.opf and getting reimported by other people which will just confuse them. I prefer a minimalist tag style.

I suspect it will be somewhere in the functions list, but I don't clearly understand most of the template language.
eschwartz is offline   Reply With Quote
Old 11-15-2013, 03:40 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,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
A plugboard cannot set tags to null (empty). I suggest that you set the tags to some innocuous value, such as the word "None".
chaley is offline   Reply With Quote
Old 11-15-2013, 02:44 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Well, in the meantime, experimentation has yielded me this:

Code:
{tags:format_number()}
By passing nothing to format_number(), I I got the formatting to fail, thus passing null to the plugboard. It's totally a hack, but it seems to works, and doesn't seem likely to set fire to my computer, so that seems to be good.

I guess I could do the same with boolean testing for random garbage, or days_between() a non-date.
eschwartz is offline   Reply With Quote
Old 11-15-2013, 05:05 PM   #4
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
My suggestion would be this:

- Install "Modify EPUB" plugin.
- Create a "Workspace" library.
- Copy the books you want to export for other people to the Workspace library.
- Remove all tags and other stuff you don't want.
- Use "Polish Books" to update metadata, and "Modify EPUB" to strip all non-DC metadata from the OPF. (Maybe you could check both "Update Metadata and "Remove non-DC metadata" in "Modify EPUB", but I have not tried this yet.)
Katsunami is offline   Reply With Quote
Old 11-16-2013, 03:33 AM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by eschwartz View Post
By passing nothing to format_number(), I I got the formatting to fail, thus passing null to the plugboard. It's totally a hack, but it seems to works, and doesn't seem likely to set fire to my computer, so that seems to be good.
I'm confused, how does setting anything in the plugboard prevent metadata from being written to the book during the send or save function?

Maybe you aren't talking about the plugboard?
DoctorOhh is offline   Reply With Quote
Old 11-16-2013, 08:29 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by DoctorOhh View Post
I'm confused, how does setting anything in the plugboard prevent metadata from being written to the book during the send or save function?

Maybe you aren't talking about the plugboard?
I assume the same way plugboards CHANGE metadata that gets written to the book.

I just managed to trick the plugboard into writing a blob of nothingness instead of the tags metadata.

Nothingness doesn't actually exist (outside of a few BookWorlds) so it de facto prevents the metadata being written.
eschwartz is offline   Reply With Quote
Old 11-16-2013, 08:33 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Katsunami View Post
My suggestion would be this:

- Install "Modify EPUB" plugin.
- Create a "Workspace" library.
- Copy the books you want to export for other people to the Workspace library.
- Remove all tags and other stuff you don't want.
- Use "Polish Books" to update metadata, and "Modify EPUB" to strip all non-DC metadata from the OPF. (Maybe you could check both "Update Metadata and "Remove non-DC metadata" in "Modify EPUB", but I have not tried this yet.)
That would be an excellent way to do stuff I don't actually need done.

I like my way better, since with a simple plugboard I have made sure calibre removes all tags from all books, but keps them in the database, and I don't have any tags except keywords I use for search/virtual libraries/notes on library maintenance I am doing.
eschwartz is offline   Reply With Quote
Old 11-16-2013, 08:40 PM   #8
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
So which plugboards are you using?
Katsunami is offline   Reply With Quote
Old 11-16-2013, 08:42 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by eschwartz View Post
Well, in the meantime, experimentation has yielded me this:

Code:
{tags:format_number()}
By passing nothing to format_number(), I I got the formatting to fail, thus passing null to the plugboard. It's totally a hack, but it seems to works, and doesn't seem likely to set fire to my computer, so that seems to be good.

I guess I could do the same with boolean testing for random garbage, or days_between() a non-date.
This one.
eschwartz is offline   Reply With Quote
Old 11-16-2013, 08:49 PM   #10
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
Oh, OK; I thought you used that as an experiment and now found a "real" plugboard to do this. I wouldn't be comfortable to trust on a failure to achieve something. Kovid may plug this hole in the plugboard, after which this won't work anymore.
Katsunami is offline   Reply With Quote
Old 11-16-2013, 08:53 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
http://manual.calibre-ebook.com/temp...-function-mode

Quote:
format_number(template) – interprets the value as a number and format that number using a python formatting template such as “{0:5.2f}” or “{0:,d}” or “${0:5,.2f}”. The field_name part of the template must be a 0 (zero) (the “{0:” in the above examples). See the template language and python documentation for more examples. Returns the empty string if formatting fails.
I saw a few mentions of that (by format_number(), days_between(), and the boolean operators) and it sounded perfect.
It sounds quite deliberate, how safe do you think it will be?
eschwartz is offline   Reply With Quote
Old 11-16-2013, 09:11 PM   #12
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
It is safe now, but still I wouldn't use a failure to achieve something. This could always be changed to return something else. It would be better if a function would be created that deliberately and *always* returns and empty string. empty_string() maybe?
Katsunami is offline   Reply With Quote
Old 11-16-2013, 09:29 PM   #13
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
What about this? Experimenting on a spare custom column...
A very simple custom function (I'm not quite up to the big stuff yet)

Click image for larger version

Name:	custom_function.png
Views:	157
Size:	37.7 KB
ID:	115299

Last edited by eschwartz; 11-16-2013 at 09:35 PM.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Other Fiction Stockton, Frank Richard: The Late Mrs. Null. v1. 10 Jul 2013 crutledge Kindle Books 0 07-10-2013 07:33 AM
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL by nimblebooks Conversion 5 11-04-2011 12:38 PM
searhc:null? cypherslock Kobo Tablets 0 11-03-2011 12:28 PM
Template error value:unknown field null sfuller Calibre 4 06-13-2011 03:02 PM
Bargain Kindle (or Free Kobo) Book: Null Pointer Loosheesh Deals and Resources (No Self-Promotion or Affiliate Links) 8 05-08-2011 09:22 AM


All times are GMT -4. The time now is 12:04 AM.


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