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
New tool to suppress leading and trailing spaces. #783
Conversation
Codecov Report
@@ Coverage Diff @@
## master #783 +/- ##
==========================================
- Coverage 42.05% 42% -0.06%
==========================================
Files 1065 1066 +1
Lines 144427 144625 +198
==========================================
Hits 60743 60743
- Misses 83684 83882 +198
Continue to review full report at Codecov.
|
Do you plan to keep the handle column? |
I could hide it. I need it to call the editor. |
If you want to get this out to users anytime soon, you might consider packaging it as an addon. The way thing are going, I don't think we will see Gramps5.1 anytime this year. |
We will probably release v5.1 in July or August. |
Can it also look at Alternate Names, Longitude, Latitude? (really any user enter-able text field) |
I added the newest changes to the 5.0.1 version on windows and get the error reporting wizard. 8609344: ERROR: tool.py: line 257: Failed to start tool.
|
The max_content_height property requires Gtk 3.22 and above. We decided on Gtk v3.12 for Gramps v5.1. |
After "Come back to Gtk 3.12 : remove max_content_height" 279416: ERROR: tool.py: line 257: Failed to start tool. |
It's difficult to know all properties glade uses. I am on Ubuntu with Gtk 3.22. |
Thanks, its working now. I will do some testing. |
It doesn't seem to be checking the alternate surname or given names. |
Can you attach a database example (.gramps) for that. |
Using current Gramps, the process of backup (.gramp) and then import fixes many of these issues. The specific issue in my test was caused originally by cutting/pasting names from web sources. When doing this, sometimes the copied text includes control characters (carriage return, line feed, tab, vtab, bell, etc.) that are considered "white space". In older versions of Gramps these control characters where not displayed, making it nearly impossible to find them. (but causing problems in many generated reports ) On Windows, I can recreate the problem in alternate names easily.
|
It works for me. We have no alternate name here. The Given and Surname names are displayed.
It works. I attached the .gramps file for which it works. I manually edit to add the new line. So, my question now is: Perhaps solving this kind of problem would be sufficient and make this tool obsolete. remove .txt in the file name before import it. |
In your PR783.gramps.txt it looks like the "newline" (\n) is in the middle of the name text. Did you try the "newline" character as the 1st or last character in the name? |
Yes. in the provided file, given, surname and alternate begin with a new line. |
I have a patch to suppress all invisible characters in the following fields: I think this is a better solution with this patch, this tool is obsolete for the Person. |
The best is perhaps to modify the MonitoredEntry class. |
This is the new patch for the MonitoredEntry. |
This seems to be progressing well. |
I think we do not need this tool if we modify the MonitoredEntry with the try_2 patch. I close this PR. I'll create a new one. Can it be a bug for gramps 5.0 ? |
it can be a bug if the we think the Gramps specification says: leading and trailing white space are not allowed in field text and will be removed. also saying that white space is any non-printing character to include space, nl, cr, tab, vtab, bell, etc. Does this apply directly for text blocks like in a Note? or should blocks of text have different rules? BUT i think this tool is still needed: |
Yes, I think that allowing control characters to be pasted into an entry field could be considered a bug. Please open another PR. We probably should allow a non-breaking space because it is used to indicate that multi-part names in Arabic and is used by the Given Names Cloud gramplet. However, you only seem to be removing control codes in the ASCII range 0-31. |
Notes are handled differently and may contain whitespace. |
for Arabic, is the non-breaking space ever the 1st or last character in the field? |
See #811 for gramps 5.0 |
@SNoiraud What was the decision about this? Do we still need the tool? |
I think we need this tool after an import. |
I suppose it is a form of data cleansing, so something like "Clean input data"? |
@SNoiraud Is this ready to merge? |
We can merge it. |
This tool is looking for place names with leading or/and trailing spaces. It also looks for in the first name and surname. For each entry which contains leading or trailing spaces, a row is added in a treeview. You can see where the spaces are for each row as the name is underlined. If you double click on the row, you can edit the Place or the Person. Fixes #10824
Note to self
[ ] the tool link to the user manual needs to be updated from
https://gramps-project.org/wiki/index.php?title=Gramps_5.1_Wiki_Manual_-_Tools#Remove_leading_and_trailing_spaces
to
https://gramps-project.org/wiki/index.php?title=Gramps_5.1_Wiki_Manual_-_Tools#
Clean_input_data
You access it from the menu "Tools > Utilities > Clean input data..."
See:
https://sourceforge.net/p/gramps/mailman/message/36905316/
|
Fixes #10824
This tool is looking for place names with leading or/and trailing spaces.
It also looks for in the first name and surname.
For each entry which contains leading or trailing spaces,
a row is added in a treeview.
You can see where the spaces are for each row as the name is underlined.
If you double click on the row, you can edit the Place or the Person.
For places, I search for comma. They are forbidden for lat/lon (related to (https://gramps-project.org/bugs/view.php?id=11114)