As I am in the process of trying to install a new third party add-on for Gramps, I am am stuck when I try to use it in an existing AIO 5.1.5 installation.
The add-on needs the Python interface to Exiftool PyExiftool.
As I am developing the add-on under Linux, where I had no problem installing all the necessary files, I got stopped in my tracks when I wanted to move and test the add-on with Windows AIO.
Is it possible at all, and if so how?
Or will I really need to install a full development setup under Windows - using MSYS - as explained on the Wiki?
You could try to do it with MSYS2, but that would not help much for the other users of the AIO.
The AIO doesn’t contain the package managers etc, to install dependencies. So that makes installing via the usual Linux methods not an option.
The LifeLineChartView addon had a similar problem in that it needed a package that was available via pypi. Take a look at the lifelinechartview.gpr.py module for how they solved it. Basically they imported within the Gramps addon startup the first time the addon was loaded; then it was available from then on.
Thank you for that information.
Another ‘hill’ to climb, but at least I won’t have to worry about MSYS.
But … that raises the question of how best to go about building and testing that sort of ‘solution’ and under which OS to start.
Naturally Linux doesn’t need it and my efforts at debugging under Windows were unsuccessful altogether
Or do I still end up back with MSYS??
If you look at the lifelinechartview.gpr.py module you will see that the author wrote it to be pretty general; only the lines near the end would would need to be modified for your application. It is designed to work the same in either Linux or Windows, so if you got it to work in Linux, it will probably work in Windows. There is a bit of win specific code, but its not in the section I think you would need to modify.
Of course this is only good for getting the pypi stuff, the exiftool itself would have to be installed by the user.
Again, I very much appreciate the extra details.
I did use pip to uninstall the pypi exiftool module and then started to try and sort out the rest, with some success and then start out by using the lifelinechartview code as a template. I did make some progress, but it seems debugging it all with Visual Studio Code under Linux/Mint is a bit of a challenge.
Still I expect to eventually get it to work.
The executable for Exiftool will present another challenge, especially under Windows as there are a couple of versions, each with its own peculiarities. I assume that if Exiftool is installed so that it is on the PATH, the Gramps add-on will be able to find it, although I would want to include a test as part of the installation code.
My current troubles are that curl does not seem to want to download the full file for PyExiftool and quits early causing the unzip operation to fail.
My curl version is 78.1.0, which is not that old
When I run the command directly on the command line, everything works fine. From that test, I can also see that the operation according to the curl output downloaded the correct number of bytes, but throws some exception and aborts the download ( i. e. it erases the downloaded data?) and installation.
Unfortunately, VSCode does not stop at any breakpoint I have set in the *.gpr.py file which makes tracking this down even slower
As to breakpoints in the gpr.py file; The gpr file is not loaded with the usual import statements, but instead is getting read from file as a string and then the string is executed. So the debugger doesn’t have a chance to insert the breakpoint into the runtime pseudo code.
I use eclipse with Pydev, so your the VSCode method may be different, but perhaps the concept will work. What I do is to add a couple of lines to the gpr file, one to import the debugger, and a second to act as the first breakpoint. I also have to set up a path to the debugger so the import statement works.
PYTHONPATH="path_to_debug_module"
import pydevd
pydevd.settrace()
My eclipse then breaks at the settrace call, at that point I can add other breakpoints or single step.
If that doesn’t work, you can always go old school, and revert to inserting print statements, maybe with an ‘if’ to thin the output.
Thank you for the clarification. Way back when I did have PyCharm working, before VSCode was on my radar, but since then, all that got lost in one or other PC upgrade.
I had used VSC with some success for other Python projects and with a lot less trouble than trying to set up either Eric or PyCharm.
Meanwhile, there are of course. many other loose ends to fix and, while I was considering how to carry on with this plugin, and trying alternatives, some those other issues got addressed
While trying your recommendation just now, under Mint and VSCode, I had no luck at all.
What I can glean from the feedback is that the file gets downloaded but fails to stick because of permission problems, even though I thought I had made sure that the path it shows as the target does have all the permissions possible.
As I have mentioned in my post at:
I have decided to drop work on trying to get the displayMetadata plugin for Windows’s AOI.
Currently I am exploring alternatives for myself and will continue to work on the plugin and its derivatives, but I do want to get back to work on my data, rather than get bogged trying to bridge the ‘divide’
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.