-
Notifications
You must be signed in to change notification settings - Fork 34
Creating a Plugin
Scripts are written in IronPython, which is a version of Python 2.7 with support for .NET, so you can use .NET Framework functions in additions to pythons.
I would start with the Samples located in the Script folder in the install location (Program Files), it covers basics. You can also check how certain plugin work. There is also the ComicRack Wiki, that you can access with the Wayback Machine (Developing Scripts basics & Scripts API Reference)
Some function are listed in the above wiki page, but also an additional source of functions you can use are directly in ComicRack. You can check the code for some more property and methods you can access. The functions is the Interface IApplication contains the commands that can be accessed by using ComicRack.App
.
There seems to be also other Interface like IBrowser (ComicRack.Browser
), IComicDisplay (ComicRack.ComicDisplay
), IOpenBooksManager (ComicRack.OpenBooks
) & the MainWindow (ComicRack.MainWindow
). I haven't tested these, but based on the code they should all be available for scripts.
There is also the ComicBook & ComicInfo class that contains more Properties than what is in the wiki and the samples, that you can use on a book object directly.
As for actually developing & debugging the scripts, your best bet is to use the command line switches -ssc
& -dso
to have a script output and just print your debug info.
All the available Hooks are under Valid Hooks, for more than what the Wiki lists.
If you want to use an IDE to debug there is a page in the wiki that tells how. Since IronPython is depreciated (Python 2 also), you will need older software Visual Studio 2017 & 2019 still support IronPython, I personally use 2017 since it seems to work better. Even then I have problems with some script that used to be able to debug easily, but now take an excruciating long time between each steps. It also seem that you have to run the script once before attaching it for the debugging to work correctly.
Also to create forms like in ComicVine Scrapper (because Visual Studio doesn't do it anymore). I have been using an old build of SharpDevelop (that I build myself) that still supported IronPython.
So I have been developing a new plugin from scratch Amazon Scrapper and because of all the caveats, what I did was just create a .NET framework 4.5 winform project and just load my form from the script and do all the work in Visual Studio 2022. So I can create forms easily, debug without much problems.
Depending on the complexity just a straight python script can be enough, but for more complex projects I suggest going to the more modern route, since all the tools available today don't support IronPython anymore.
- Home
- Android
- New Features
- Frequently Asked Question
- References
- Plugin Development