![]() |
#256 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@BR: But that's the problem. The Search The Internet plugin is designed to build a search URL and get that handled. The Open With plugin is designed to pass a books path to an executable with some options. Neither does what Vortex wants.
My thought was to change the Open With plugin to have an option that parses templates like the Search the Internet plugin and optionally includes the file path. After a quick look at both plugins, I think the hardest part of doing this is making sure the existing function didn't break. Well, the template parsing might be a bit harder, but hopefully calibre has some helpers to ease the pain. My other suggestion was a wrapper script. It could be put into the Search The Internet plugin in the same way you suggested for the everything search executable. The script would convert the search parameters from URL style to those needed for the search program and then call it. |
![]() |
![]() |
![]() |
#257 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Putting my money were my mouth is...
Attached is version of the Open With plugin that I think does what Vortex want. The visible changes are in the configuration dialog. In the "Format" column, I have added the type "TEMPLATE". When this is selected, the text entered in the "Args" column is treated as a template. When you select a book and Open With the template item, the text in the args column is evaluated as a template. This is then passed to the application being opened as the parameters. The file name of a book format is not used. So for Vortex, you should create an Open With item with: - Title: Everything Search - Format: TEMPLATE - Application: C:\Program Files\Everything\Everything.exe - Args: -search {authors} {title} With that, it should pass the authors and the title of the book as the search string. I don't use Everything Search, so I don't know the exact parameters. This is a quick and dirty change. There is no validation or error checking. If it is close to what is needed, and works for others, I will finish it up. |
![]() |
![]() |
![]() |
#258 | |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Thanks for trying that out, David.
Using the exact settings as above, I get the 'Everything' error message: Unable to open file list: C:\Users\-\Desktop\-search <Authors Name> <Book Title> is not a valid file list. Which is odd as neither the book nor 'Everything' are located on the desktop. If I remove all the Args so the box is empty, it then opens an empty Everything search box. Quote:
Using the webrun: protocol ( http://www.webrunapps.com/ ), which is the same idea as the AHK solution that Chaley suggested: webrun:C:\Everything\Everything.exe -s {title} That opens everything with the search term passed but with + symbols between every term. If I put title (and/or author) into double quotes it gives the error "not a valid file list" My next idea was to use some kind of intermediary like a batch file to send the search term to, clean out the + symbols and then pass it on to 'Everything'. Last edited by Vortex; 05-02-2015 at 06:09 AM. |
|
![]() |
![]() |
![]() |
#259 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,335
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I am glad I didn't do any eye rolling.
![]() Is there a reason that you didn't simply allow templates in the args column for all the formats? This would work easily unless people are using paired { } characters in their arguments, because the template processor passes through anything that isn't a template language expression. If use of braces is a concern (I have no idea) then you could use a prefix to indicate that the argument string is to be passed through the template processor after stripping off the prefix, perhaps something like {TEMPLATE} or ::TEMPLATE::. Another thought: my guess is that the path to the file is tacked onto the end of the command after the arguments. I can easily imagine cases where that isn't what one wants. If one can use the template processor in any argument list then the user can put the filename wherever it is needed. The trick is to put the path where the template processor can find it. I suggest that sticking it into an "odd" identifier is the best way to go. Something like the following: Code:
def init_cache(library_path): from calibre.db.backend import DB from calibre.db.cache import Cache backend = DB(library_path) cache = Cache(backend) cache.init() return cache from calibre.ebooks.metadata.book.formatter import SafeFormat cache = init_cache(library_path = sys.argv[1]) formatter = SafeFormat() # Loop through all the books in the library for id_ in cache.all_book_ids(): mi = cache.get_metadata(id_) mi.set_identifier("**filepath", cache.format_abspath(id_, "epub")) print(formatter.safe_format("{title} {tags} {identifiers:select(**filepath)}", mi, _('TEMPLATE ERROR'), mi )) |
![]() |
![]() |
![]() |
#260 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
![]() Quote:
Quote:
And thinking of this, the "TEMPLATE" type should be "NONE" which would be "don't add the file name at all". But, it isn't as needed if all formats allow templates. |
|||
![]() |
![]() |
![]() |
#261 | ||||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
The plugin was not building the command line in the way I thought. I have attached a version that fixes this. When creating the Open With entry, the search string must be enclosed in quotes. So, set the "Args" to something like: -search "{authors}" Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#262 |
Groupie
![]() Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Working perfectly
![]() Also works OK with: -search "{title}" -search "{authors} {title}" Thank you, David ![]() |
![]() |
![]() |
![]() |
#263 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Good to hear that it is working. I'll have a look at how to make the template use for the other formats in the next few days. And any further discussion will be over in the Open With thread.
|
![]() |
![]() |
![]() |
#264 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,616
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
See https://www.mobileread.com/forums/sho...&postcount=231
Quote:
I would have thought that that could be exact situation for doing a local search with something like Everything - "I'm sure I had this darn thing somewhere" ![]() I guess one could use the cover.jpg or metadata.opf as the designated file type. Should I move the relevant posts from search the internet into here ? BR |
|
![]() |
![]() |
![]() |
#265 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
BR: A couple of posts further up I suggested the format "NONE", maybe "ALL" would be a better term. "NONE" suggests no formats, but "ALL" would be for any book no matter what format. Working that out is one of the reasons I labelled what I did as a "quick and dirty" change. Suggestions for how to do it are welcome.
As to moving the posts, I don't mind either way. We have a cross-reference now, so they won't get lost. |
![]() |
![]() |
![]() |
#266 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,616
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@davidfor - the 'hangup' I have with the additional functionality being tacked onto the Open With PI is that it 'prolongs' the life of the PI, which, IMO at least, has for all intents and purposes been replaced with the recently added built in Open with functionality.
I uninstalled the PI and its json and html files as soon as I could. Primarily so I didn't have Open With and Open with sections in Preferences->Keyboard. I would think new users (even existing ones) could get easily get confused between the two - this is not the PI. I'll leave it at that. BR |
![]() |
![]() |
![]() |
#267 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Perhaps a minor rename would be in order. Anyway, the plugin does sterling service on Windws XP I shuld think, also the builtin feature doesn't allow editing the cover metadata of the book record.
|
![]() |
![]() |
![]() |
#268 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#269 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,176
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can edit covers with the builtin open with by right clicking on them in the book details panel.
|
![]() |
![]() |
![]() |
#270 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
Tags |
conversion, kepubify |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Search the Internet | kiwidude | Plugins | 435 | 05-07-2025 03:23 AM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |
Gui confusements. | brewt | Calibre | 8 | 12-30-2008 12:16 PM |
Reference Open eBook Forum: Open eBook Publication Structure. IMP. V1.0.1 14 September 2007 | DaleDe | IMP Books | 0 | 09-14-2007 05:06 PM |
iLiad GUI for the iLiad | tribble | iRex Developer's Corner | 1 | 06-01-2007 02:29 PM |