Feel free to ask if you need any help.
This has already been agreed and we will start introducing type hints in the next release.
Feel free to ask if you need any help.
This has already been agreed and we will start introducing type hints in the next release.
In case you want to watch that GitHub discussion:
gramps-project:master
← DavidMStraub:types_squash
Thanks for your review @QuLogic. This is now ready for merge. Then I can work on…
Media object writer could convert Media paths to absolute on the fly.
Would it be a reasonable enhancement request to add a Gramps XML and package export option to: “convert relative media paths to absolute”?
If you run Betty on another machine, there’s a big chance that its home or users directory is not exactly the same as on the machine that did the export. And in fact, it may even run another OS.
This means that even if you have a base media path, it may not work, and absolute paths may not work either. And in most cases, the user does or should know where the files really are, and should hence be able to specify a base path and/or a replacement path.
Excellent work on adding type hints! I left a few comments based on my experience converting Betty from untyped to typed. I hope they’re useful
Updating Gramps to ensure a media path is set whenever an export is created, would solve my problem, and others (including migrating a family tree from one machine to another, assuming the same OS family). I’d be happy with such an update
I left a few comments based on my experience converting Betty from untyped to typed. I hope they’re useful
Thank you. Any feedback is always appreciated and often very helpful.
Thanks, everyone, for your comments! I went ahead and implemented a solution that raises a helpful error as soon as it encounters a file with a relative path, and the family tree XML does not specify a base media path: Support relative file/media paths when loading Gramps family trees by bartfeenstra · Pull Request #2194 · bartfeenstra/betty · GitHub
Would it be a reasonable enhancement request to add a Gramps XML and package export option to: “convert relative media paths to absolute”?
It would probably be better to export the default media path if one isn’t defined in the settings.
It would probably be better to export the default media path if one isn’t defined in the settings.
Submitted Feature Request
0013493: [XML export] include a default media path for those not explicitly…
Setting a default media path in an export would meet the needs of Betty. But what of the backup being imported into a new Gramps database. You would be setting a media path that the original did not have.
There are a number of issues that need to be resolved for importing XML with regards to media and their paths.
Right now, import chokes on repeated attempts to import a .gpkg archive. This is because the import first creates a folder for the Relative Path media files. It that folder already exists, the import fails with a very unhelpful message.
This could be resolved in any of 3 ways…
A better but MUCH more complex option would be to compare the directory and MD5 checksums of the existing folder against the archive. Then flag differences kmissing, new, MD5 mismatches) with resolution options.
If you do an import, you may need to change the path to fit the directory structure on the importing machine, especially when you work with a different account on that, because that often leads to a different home directory.
And further on, the whole thing is futile, if you run Betty on a machine that doesn’t have a Gramps at all.
I like the idea of a base media path and I use it.
My issue is that if Gramps does not need a base path and will accept media without a path set, why on a backup/export is Gramps now saying the base path is needed.
On a major upgrade, I will often make the transition by doing an import, not letting Gramps ‘convert’ the database. If I did not have the base path previously set, after the import, I know have one. ???
My issue is that if Gramps does not need a base path and will accept media without a path set, why on a backup/export is Gramps now saying the base path is needed.
Good point, and that may be a reason to keep it empty, because in that case, it moves with your home folder, and there is no reason to change it when you move to another machine.
And if that works, it can save us a lot of support ‘calls’.
Yes. This probably needs more thought.
We should probably link an old (2008) MantisBT in the discussion. Any resolution here will resolve it too.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.