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:
In
send_to_device_template_history = cPickle.loads
I have:
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.