-
Notifications
You must be signed in to change notification settings - Fork 115
Polish&refactor code for lxml and etree gramplets #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: maintenance/gramps60
Are you sure you want to change the base?
Polish&refactor code for lxml and etree gramplets #707
Conversation
@giotodibondone
Yes, there is also maybe a possible improvement as "on/at" is not very elegant. I supposed that there was a fallback (skip if About additions, this might be also confusing because modifications are included too. So, the idea behind the sentence is rather : "Edit" + (adding or modify) :) |
Haven't tried the addon but thank you for it 👍
Edition is not really a word used in English for that purpose it just looks and reads wrong to an English speaker, I suggest as mentioned on stackoverflow to use the words like editing/edit(s) or revising/revision(s) so maybe just Edits in this case? The etree gramplet screenshot also shows "XML: Number of records and relations: " what do you mean by "relations" as it also does not sound quite correct in English? |
oh, ok, my bad as Edition sounds right in french (in fact Édition will be correct in french). Thanks.
Ah, yes, relations in this context means "relations between records". To go further, need to look at So, the additional records and relations is the total of relations between records without the top primary objects. As some records can be shared, we have more "relations" than records. Into the gramplet, the counters will list all matching "active sequences". A pseudo snapshot or skeleton of the Gramps XML file according to data detected. It is like making a puzzle, you can group pieces by type (the sky, a tree, a house). All these groupes are related but you need to know the location (position or coordinates). So, the idea behind the word An other sample, with a photo after a marriage. You can see most (all?) people, you know the date and the place of the event, or the repository/source/citation/note. During this marriage event, there is multiple families, with many persons having different dates of birth and event places during their lifes. So, to make a large global timeline with multiple places, sources and date from a starting point like this marriage event, will be more than a challenge : this could be painfull. Now, with a basic model (format a marriage with only two persons), just list any minor variations (add parents, uncles and aunts), some families with or without children. The model will grow but you can still easily manage it. A basic set of lists, like counters on Primary objects. Now, the So, as records are all more and less related, I used the word "Relations". If need, you can use and replace by the word "inter-links", instead. How to list them? Well, this should be "easy" via a simple print() statement, but does it make sense to generate a large list of more than 42 600 {tags, records, relations, paths/links} with
Maybe if you can find the same type of global counter (total of tags and paths/links) on the active Family Tree, any minor difference between the content of a Gramps XML and the active database will be quickly displayed. As you can see with |
@GaryGriffin
https://stackoverflow.com/questions/2209755/python-operation-vs-is-not As it was working on Windows OS ('nt'), I still wonder why your version will complain. Anyway, you get the icons issue too. So, need to also add the check for 'mac' os. How do you get the SyntaxWarning and tips? Is it via the debug flag or your python version? I suppose that custom Gtk icons stock will be displayed under Gnome environment. So, it might also failed under KDE, xfce desktops (linux, BSD and so)... A little bit strange as python 3.6 (and maybe python 3.11/3.12 for Windows AIO) can make these 'is/is not' tests. I will revert the refactoring and polish on these sections. Thanks! |
`darwin` plateform and `nt` OS cannot use custom set of icons This might also failed under KDE or xfce desktop manager under linux?
Uploaded the latest PR. When running etree on Mac, I no longer see warning messages (they appeared in the 1st instance of running previously). And I now see the Run button. But I get an error:
Note that the default Mac path for plugins and db is: ~/Library/Application Support/gramps. Edit: Console error message: |
There is in fact a whitespace character in the path. The fact that the code is warning about it suggests a defect: 21st century code should be able to handle whitespace and unicode codepoints in pathnames. |
spacing on path remains on lxml only
Oh, happy to learn that Mas OS also has a preferred folder name (hierarchy path) with a whitespace character! 'Program Files', 'Google Drive', 'Application Support', etc.
I think I was able to identify the cause //see #700 (comment) and next comments// : |
IIRC |
part 2. will be added soon (I hope!)
Need to change the method as written on the fly is maybe not a good idea.
from gramps.gui.dialog import ErrorDialog
need to rewrite after a better review
still need to polish, but errors should be somewhere else...
Well, I made some pieces of the code "upside down", but still got this strange issue. Maybe something in memory or buffer. A failure somewhere, which will generate an empty "test.xml" (secondary code or pass). Need more time for looking at refresh, clear, purge & co on
|
step by step, comments, limit cpu usage and Element in buffer (on the fly)
and handle, change, type, etc. attribute on primary objects
Previously, I forced use of This cannot explain why it is hidden via
I guess that I will have fun to play with quoting, simple and multiple quote... |
Thank you all!
Oh, it means that I should at least backport the fix to gramps 5.2 branch and remove the warning about spacing and whitespace... -os.system(f'gunzip < {entry} > {filename}')
+os.system(f'gunzip < "{entry}" > {filename}') Maybe I will create a new local branch and a new PR as 24 commits sounds too much for a refactoring, polish and fix. |
not a very elegant hack
see also #700