Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-05-2023, 02:44 PM   #1
estherflails
Member
estherflails began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2021
Device: none
Question Installing two versions of the same plugin

Hello all

I wanted to know if it was possible to install two versions of the same plugin and have them work separately. I want the old version for a functionality that is missing from the new one.

I got as far as changing the name in __init__.py so the old version didn't overwrite the new, and in the Plug-ins menu they both show up separately, but I can't find the old version in Toolbars & menus, it's just missing for some reason. So I can't actually use it.

Any suggestions on what else needs to be edited or what I could do to make this work?
Many thanks!
estherflails is offline   Reply With Quote
Old 04-05-2023, 02:50 PM   #2
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,973
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
One user duplicated the Favourites menu:

https://www.mobileread.com/forums/sh...15&postcount=4

Comparing it to the Favourites menu code they changed all instances of 'favourites' and 'fav' to 'searches'
ownedbycats is offline   Reply With Quote
Advert
Old 04-05-2023, 04:42 PM   #3
estherflails
Member
estherflails began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2021
Device: none
Quote:
Originally Posted by ownedbycats View Post
One user duplicated the Favourites menu:

https://www.mobileread.com/forums/sh...15&postcount=4

Comparing it to the Favourites menu code they changed all instances of 'favourites' and 'fav' to 'searches'
Thank you! I checked it out, and used a program to replace the text in all the files (the plugin I'm trying to do this with has a lot of script files and it would take way too long to go through and edit all of them). For some reason, even though the name is changed as well, now it again replaces the original and I really have no idea why. I even tried installing a plugin I don't need and replacing its files with the old version of the plugin, but then it just acts like I have that plugin installed twice in the Plug-ins menu and neither shows up in Toolbars & menus. I... I really don't understand why this is happening 😂
estherflails is offline   Reply With Quote
Old 04-05-2023, 05:11 PM   #4
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,973
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I PM'd the user who made the searches menu - maybe there's some non-obvious thing that also needs to be changed

Just out of curiosity, is this the version of Find Duplicates with the advanced mode?
ownedbycats is offline   Reply With Quote
Old 04-05-2023, 05:25 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I suggest you raise your issue in the plugin's thread ==>> Index of plugins. The ramifications of running two versions of the same plugin will vary between plugins.

Meantime, can you tell us which plugin you're referring to?

BR
BetterRed is offline   Reply With Quote
Advert
Old 04-05-2023, 06:04 PM   #6
estherflails
Member
estherflails began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2021
Device: none
The plugin is Fanficfare. I want to get the 4.19 version working so I can use FanFictionDownloader for browser cache for FF.net again, since that's not possible anymore as of 4.20. I tried just replacing the fanfiction.net adapter file from the 4.19 version but that didn't work. :/

I guess if I can't get the duplicate plugin to work, I could install another instance of calibre and use the old version there, but I thought this would be easier 😂 Or I could just straight up go back to that version and only update the adapters I use, it's not that outdated (for now).
estherflails is offline   Reply With Quote
Old 04-05-2023, 06:17 PM   #7
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by estherflails View Post
Hello all

I wanted to know if it was possible to install two versions of the same plugin and have them work separately. I want the old version for a functionality that is missing from the new one.

I got as far as changing the name in __init__.py so the old version didn't overwrite the new, and in the Plug-ins menu they both show up separately, but I can't find the old version in Toolbars & menus, it's just missing for some reason. So I can't actually use it.

Any suggestions on what else needs to be edited or what I could do to make this work?
Many thanks!
Basically, you need three mandatory changes:

1) Change the name on the __init__.py file, like you already did. Lets suppose it is now PLUGIN_NEW_NAME.
2) Then you need to rename the file "plugin-import-name-PLUGIN_NAME.txt" to "plugin-import-name-PLUGIN_NEW_NAME.txt".
3) Search and replace across all the files:
Search: from calibre_plugins.PLUGIN_NAME
Replace: from calibre_plugins.PLUGIN_NEW_NAME

Now, this is the basic, but I can't promise it will always work. One good example of what can go wrong is shortcut management. They might have the same unique name, and also the same trigger.

But with these three changes you will be able to duplicate most plugins.
thiago.eec is offline   Reply With Quote
Old 04-05-2023, 08:06 PM   #8
estherflails
Member
estherflails began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2021
Device: none
Quote:
Originally Posted by thiago.eec View Post
Basically, you need three mandatory changes:

1) Change the name on the __init__.py file, like you already did. Lets suppose it is now PLUGIN_NEW_NAME.
2) Then you need to rename the file "plugin-import-name-PLUGIN_NAME.txt" to "plugin-import-name-PLUGIN_NEW_NAME.txt".
3) Search and replace across all the files:
Search: from calibre_plugins.PLUGIN_NAME
Replace: from calibre_plugins.PLUGIN_NEW_NAME

Now, this is the basic, but I can't promise it will always work. One good example of what can go wrong is shortcut management. They might have the same unique name, and also the same trigger.

But with these three changes you will be able to duplicate most plugins.
Thank you!!! It works now! 🎉🎉 I did also need to replace the plugin name in every file, and also in a folder I missed earlier, but everything's good now.
Thank you everyone!
estherflails is offline   Reply With Quote
Old 04-06-2023, 03:00 AM   #9
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by ownedbycats View Post
Comparing it to the Favourites menu code they changed all instances of 'favourites' and 'fav' to 'searches'
That's pretty much it, OBC.

Oh, and the filename changes Thiago.ecc mentioned were also mandatory to clone FM. I'd just open all files within the PI archive in Notepad++ and look into what I intuitively thought would have to be changed, as I'm no coder!

As FFF is a way more complex PI, I never thought it would be feasible, lol. Glad the OP managed to make it!

BTW, I've once played a bit with FFF and I found the Proxy Feature simply amazing (with nsapa proxy). It would work like a charm for the site I wanted to mass-download, so I never got to use browser cache.

As for duplicating FM, I got a bunch of clones of it in my menubar but the one I'm using more currently is BRmenu, which I place on the context menu for the books in the library. It's my favourite clone, I've attached it in case someone wants it.
Attached Files
File Type: zip BRMenu Menu.zip (15.5 KB, 107 views)
Comfy.n is offline   Reply With Quote
Old 04-06-2023, 04:12 PM   #10
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,971
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I've never given any thought to trying to run multiple versions of FanFicFare. It's clearly an unsupported use.

That said, I can't think of any direct issues at this point.

Whether the renamed version will still share settings will depend on how thorough you were renaming things. The FFF settings are stored in the library keyed by a hard coded 'namespace' string.

I would consider it easier to write a pair of scripts to install the appropriate plugin version with 'calibre-customize -a <zipfile>' and start Calibre, but I do that basically every time I run Calibre.

As for the root issue, FanFicFare Browser Cache not reading FFDL cache now: I've considered bringing that back more than once, but it doesn't fit well. And there are five other alternatives (2 Proxies, open_pages_in_browser, WebToEpub & manual cache loading).
JimmXinu is offline   Reply With Quote
Old 04-06-2023, 05:37 PM   #11
estherflails
Member
estherflails began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2021
Device: none
I figured you had a good reason to remove compatibility, it's fine, I managed to make it work anyway The renamed version has separate settings btw, it doesn't seem to have caused any problems with the original.

I used flaresolverr sometimes in the past but it's quite slow for me and often didn't work, so it's not my favorite. I prefer to be able to do it in the background without having to manually open every fic so while the other options are great to have, I'm too lazy to use them often. I totally forgot about nsapa's proxy since I couldn't figure out how to install it back when this all started, but I did it now and it works well! Thanks for the reminder!

I couldn't resist doing a little test. To download the same (18 chapter) fic
Nsapa took 3:58,
Flaresolvver took 4:42,
Fanfictiondownloader took 3:08, minus the negligible time it takes to add it to calibre.

My slow_down_sleep_time setting is 10, and in Fanfictiondownloader I set the delay to 10 as well for this test. I normally have both the delay and dynamic delay at 6, and it took somewhere between Nsapa and Flaresolvver with those settings.
estherflails is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help Request] Installing 'Hello World' plugin for testing purposes SylvanKnight Development 6 10-16-2022 09:49 PM
Is installing multiple versions supported? bob.f Calibre 5 10-05-2019 04:55 PM
error installing plugin wonk Plugins 3 06-21-2016 04:44 PM
Error installing 3rd party plugin clittle Plugins 0 01-09-2013 11:40 PM
nOOb help - Installing a calibre plugin SilentSeven Plugins 3 09-12-2010 12:15 PM


All times are GMT -4. The time now is 02:41 AM.


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