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 11-22-2013, 02:19 PM   #1
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
Question Delete template

I have a number of templates I do not use anymore.
Can I delete them?

If Yes, can anybody tell me how?
imans314 is offline   Reply With Quote
Old 11-22-2013, 03:35 PM   #2
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,421
Karma: 85000000
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Yes, but which type of templates? They are used in a number of places.
  • If it's a custom column, go to Preferences ==> Interface ==> Add your own columns, select the no-longer-used column and click the recycle symbol to delete it.
  • If it's a plugboard, go to Preferences ==> Import/Export ==> Metadata plugboards, select the plugboard, and click Delete plugboard.
  • If it's the Save to Disk template, go to Preferences ==> Import/Export ==> saving books to disk, and click Restore defaults in the top-right corner.
  • If it's a Send to Device template, then either
    1. For the universal device template, go to Preferences ==> Import/Export ==> Sending books to device, and click Restore defaults in the top-right corner.
    2. For Per-device templates, go to plug in your device, and under the Device library, choose Configure this device from the dropdown, then under Save template, replace the contents with this default value:
      Code:
      {author_sort}/{title} - {authors}
eschwartz is offline   Reply With Quote
Advert
Old 11-22-2013, 04:25 PM   #3
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
It is in the Save to Disk template.

But by restore default I will lose the templates I want to keep.

I was hoping it is possible to delete only one template.
imans314 is offline   Reply With Quote
Old 11-22-2013, 04:59 PM   #4
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,421
Karma: 85000000
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Restore default only works on the particular Preference setting you show. So by going to:

Preferences ==> Import/Export ==> saving books to disk

You will restore the default only for Saving books to disk. same goes for any other Restore defaults button; they exist in every single Preferences submenu (except for plugins and Sharing books by email, which are grayed out) but it only restores the default of the submenu view you have open.

Also, the replacement text I gave you for per-device templates is also the default for saving to disk and the universal send to device template; I only told you to use this instead of restore default because the only way to restore the default (that I know of) is to remove the profile from the configuration folder, which is needlessly complex.

TL;DR -- restore default will only delete the currently-viewed template, or just use
Code:
{author_sort}/{title} - {authors}
there too. Either works.
eschwartz is offline   Reply With Quote
Old 11-22-2013, 05:07 PM   #5
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
thanx, i will try that.
imans314 is offline   Reply With Quote
Advert
Old 11-22-2013, 05:42 PM   #6
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
this is not working :-(

when I replace the text of the themplate with your code, it just adds it.

Any other tips?
imans314 is offline   Reply With Quote
Old 11-22-2013, 05:45 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,421
Karma: 85000000
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Did you delete what was already there??

There is no earthly reason for it to only append that template fragment.

Also, you could just use the Restore default button...
eschwartz is offline   Reply With Quote
Old 11-22-2013, 05:54 PM   #8
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
What I did step by step:
Copied your text (Ctrl+C)
Preferences
Saving books to disk
select the template I want to delete
Teplate editor
delete the text in the top part
Past your text (Ctrl + V)
OK
Apply
Close Preferences

When I go back to the preferences, your text is the first template I see in the list.

What am I doing wrong?
imans314 is offline   Reply With Quote
Old 11-23-2013, 09:22 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,421
Karma: 85000000
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Wait a minute -- so it IS using my template, but you are seeing old templates as a dropdown, and you want to get rid of the dropdown history?
eschwartz is offline   Reply With Quote
Old 11-24-2013, 06:07 AM   #10
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
Yes, dat would be nice.
imans314 is offline   Reply With Quote
Old 11-24-2013, 01:33 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 28,238
Karma: 47704482
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
They don't really hurt anything

To purge obsolete export templates, you will lose all settings for the export type Post 2 https://www.mobileread.com/forums/sho...38&postcount=2listed the different kinds

All the user templates are in the calibre configuration folder:
save_to_disk.py

others (sample)
device_drivers_FOLDER_DEVICE_FOR_CONFIG.py
device_drivers_HANLINV5.py

Deleting the specific file will reload the Default the next time the configure device setting option is used
theducks is offline   Reply With Quote
Old 11-24-2013, 04:55 PM   #12
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,421
Karma: 85000000
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Actually theducks, custom device drivers don't seem to have template history.

And the Save to Disk DOES have history, but it's not actually located in save_to_disk.py anyway.

@imans314, you will need to copy out your templates, restore, then add back in the ones you want to keep.

Or you could:

Go to your calibre configuration folder. This will be located at %APPDATA%\calibre, or you can go to calibre Preferences ==> Advanced ==>Miscellaneous, and click the button that says "open calibre configuration directory", then close calibre after the config folder pops up.

Open gui.py in a text editor. Notepad may or may not work, there is a chance the file will use linux line breaks which notepad cannot read, if so, you may need to install notepad++ or similar.

There will be a set of values similar to this from my gui.py:

Code:
# save to disk template history
# Previously used Save to Disk templates
save_to_disk_template_history = cPickle.loads('\x80\x02]q\x01(XG\x00\x00\x00{author_sort:sublist(0,1,&)}/{title}/{title} - {authors:sublist(0,1,&)}q\x02X)\x00\x00\x00{author_sort}/{title}/{title} - {authors}q\x03e.')
you need to edit the value of
Code:
cPickle.loads('bunch-of-values-separated-by-hex-data')
to read:
Code:
cPickle.loads('bunch-of-values-separated-by-hex-data-minus-what-you-don't-want')
When you replace it, you will have to know which hex data to leave in. I don't know exactly how this gets used, so you would really have to know what you are doing. I do know that deleting everything in the quotes will wipe the history altogether.

I will hazard a GUESS, an educated guess, how it works, but no guarantees whatsoever:

Using the data from "main_search_history = cPickle.loads('{data}')" I get this, with the start codes in blue and separators in red, leaving actual searches standing out in black:

Spoiler:
Quote:
\x80\x02]q\x01(X\x08\x00\x00\x00hammeredq\x02X\x07\x00\x00\x00hiaasenq\x03X\x0b\x00\x00\x00the shiningq\x04X\x0c\x00\x00\x00a wanted manq\x05X\t\x00\x00\x00salvatoreq\x06X-\x00\x00\x00Magic Bitesq\x07X\x07\x00\x00\x00cashoreq\x08X\x14\x00\x00\x00Fictitious characterq\tX\x15\x00\x00\x00(Fictitious characterq\nX\x10\x00\x00\x00jeremiah tolbertq\x0bX\x07\x00\x00\x00butcherq\x0cX\x07\x00\x00\x00asdasdaq\rX\t\x00\x00\x00tags:trueq\x0eX"\x00\x00\x00formats:"=AZW3" and ondevice:falseq\x0fX\x0e\x00\x00\x00ondevice:falseq\x10X&\x00\x00\x00not formats:"=AZW3" and ondevice:falseq\x11X\x13\x00\x00\x00not formats:"=AZW3"q\x12X\x10\x00\x00\x00imperfectionistsq\x13X\x0f\x00\x00\x00formats:"=AZW3"q\x14X\x0b\x00\x00\x00marked:trueq\x15X\x0e\x00\x00\x00formats:"=PDF"q\x16X\x0b\x00\x00\x00formats:PDFq\x17X\x0c\x00\x00\x00formats:azw3q\x18X\r\x00\x00\x00proven guiltyq\x19X\x11\x00\x00\x00castle in the airq\x1ae.


In send_to_device_template_history = cPickle.loads
I have:
Spoiler:
Quote:
\x80\x02]q\x01(X\x0b\x00\x00\x00{#filesave}q\x02XS\x00\x00\x00program: ifempty(field('#filesave'), template('{author_sort}/{title} - {authors}'))q\x03XO\x00\x00\x00program: ifempty(field('#file'), template('{author_sort}/{title} - {authors}'))q\x04X!\x00\x00\x00{author_sort}/{title} - {authors}q\x05X\x15\x00\x00\x00{author_sort}/{#file}q\x06XL\x00\x00\x00{#file:'ifempty(file, template('[[author_sort]]/[[title]] - [[authors]]'))'}q\x07XM\x00\x00\x00{#file:'ifempty(#file, template('[[author_sort]]/[[title]] - [[authors]]'))'}q\x08e.


Leaving the start code aside, we seem to have q\x01 incremented from 01-19, then 1a in the end code, or else 01-07, then 08 in the end code, then the end code ends, followed in the middle codes by 2 pieces: X\{random}\ where {random} is a one-symbol unique identifier (I don't see any patterns). This one symbol may be written in hex, though. This is followed by x00\x00\x00 otherwise known as null, three times.

So, if you delete any search terms/templates in black, then switch all the incremented section backward to compensate for the section you removed, it might work properly. But if you start playing around with this, you may want to back up the config folder first. It would be easier to just re-enter all the values.

Last edited by eschwartz; 11-24-2013 at 05:17 PM.
eschwartz is offline   Reply With Quote
Old 11-25-2013, 01:57 PM   #13
imans314
Enthusiast
imans314 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Jul 2012
Device: sony prs-t1
I think I am going for the restore version, the other looks very difficult.
imans314 is offline   Reply With Quote
Old 11-25-2013, 06:24 PM   #14
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,421
Karma: 85000000
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 imans314 View Post
I think I am going for the restore version, the other looks very difficult.
I thought so, yeah.

Just remember the templates you want, to re-add them.
eschwartz is offline   Reply With Quote
Old 11-29-2022, 05:08 PM   #15
johnr79
Junior Member
johnr79 is on a distinguished road
 
Posts: 1
Karma: 58
Join Date: Mar 2020
Device: kindle fire hd
Old thread but always handy if people are looking for this answer:
go to your calibre folder located @

C:\Users\%username%\AppData\Roaming\calibre

open gui.py.json and search for"save_to_disk_template_history": [

you should find something like this: just delete the templates that you no longer need and restart calibre

"save_to_disk_template_history": [
"{author_sort}/{title} - {authors}",
"{author}/{title} - {Authors}",
"{author}/{Series}/[{series_index:0>2s}-{Series}] - {title} - {Authors}",
"{author}/{Series}/{series_index:0>2s}-{Series} - {title} - {Authors}",
"{Author}/{Authors} - {title}",
"{Authors}/{Authors} - {title} - [{Series} {series_index:0>2s}]",
"{#mytag}/{Series}/{authors} - {title} - [{Series} {series_index:0>2s}]",
"{Authors}/{Authors} - [{Series} {series_index:0>2s}] - {title}",
"{author}",
"{#mytag}/{Series}/{authors} - [{Series} {series_index:0>2s}] - {title}"
johnr79 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
Help with template language Pepin33 Calibre 8 11-11-2012 09:32 AM
Help with template KALKITO Library Management 1 07-02-2012 03:54 PM
Changes in template evaluation in V0.8.43 chaley Library Management 1 03-16-2012 04:12 PM
Template help needed Soxendom Calibre 2 01-05-2012 12:30 PM
Delete files in PC not equal to delete in Sony reader 505 sheilalayoli Sony Reader 5 07-12-2009 04:13 PM


All times are GMT -4. The time now is 09:41 PM.


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