View Single Post
Old 07-15-2017, 09:03 AM   #2343
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: 7,025
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by bugstomper View Post
However, is there any way to make it so I don't have to manually unzip the plugin, add in my adaptors and modified __init__.py, and zip it up again every time Calibre updates the plugin? Perhaps something that could go in personal.ini to specify paths of custom adaptors or specify a directory containing them?
When I re-designed the internal structure several years ago, I tried really hard to set it up so all that was required was having adapter source files in a certain directory (inside the zip, for plugin) with a common name pattern.

I was never able to come up with a way that worked across all three FanFicFare platforms (Calibre plugin, web service and python CLI). Admittedly, I was new with Python then and I'm still no classloader expert now.

Plus, even if I could I'm not sure it would be a good idea to allow loading of arbitrary code for security reasons.

Your best bet right now is to keep your code in your own github fork, merge my upstream changes into that periodically and install that version in your calibre. This does require git and learning a least a bit about how to use it.

Roughly:
  1. Make a github account
  2. Create a fork of the FanFicFare project on github (there's a 'fork' button)
  3. Clone your fork to a working directory on your Calibre machine (follow github instructions)
  4. Set an upstream remote to the project (git remote add upstream https://github.com/JimmXinu/FanFicFare.git)
  5. Create (and checkout) a branch in your working directory (somewhat optional)
  6. Make your changes in your working directory and commit them
  7. From your working directory, run FFF's makeplugin.py
  8. Install the plugin zip in Calibre with calibre-customize -a FanFicFare.zip
  9. Then, when FanFicFare updates, instead of installing normally, go to your working directory, merge upstream changes with git fetch upstream; git merge upstream/master then repeat steps 7 & 8.
JimmXinu is offline   Reply With Quote