Skip to content
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

Internet tab added to Media category. #1200

Closed
wants to merge 2 commits into from

Conversation

janskarvall
Copy link

Supports database upgrade, export and import of XML as well as web report.

@Nick-Hall
Copy link
Member

A unit test is failing.

@janskarvall
Copy link
Author

janskarvall commented May 25, 2021 via email

@prculley
Copy link
Contributor

As you have surmised, this tool is primarily testing to see if there are changes by comparing a test db to a previous run by the last developer. The db generation uses random numbers to create the objects for test and is VERY sensitive to changes. As to why, I'm not sure, perhaps some part of the random number generation is in some way content sensitive, you would have to look at how each of the object generation code items was done to see if you could find this.

Note, I have also found that the check is very sensitive to settings for Gramps. When it runs in the Travis, it is running as a clean install. When run on your own systems (or mine) it may be using different settings, resulting in the random object generation producing different results. So trying to get a run result on your own system that matches the template values in tools_test.py is difficult at best. For this reason, when I update template values in tools_test.py for the result, I take them from the Travis run from the PR, after very carefully making sure that the resulting changes due to the other PR elements are really doing what we want.

I think it would be a good idea to get the check.py cleanup_empty_objects CHANGE_ table fixed up first (this is a poor design, in that it doesn't get automatically fixed when objects are redesigned). Then capture the output of the test, and try your PR again, with the CHANGE_ values updated for the PR as well as the wrong media and place values. Than MAY be enough to allow a test match. I'm guessing this, as if the CHANGE_* values are wrong, the check might be incorrectly detecting empty objects. And this may affect some of the other test results.

@janskarvall
Copy link
Author

janskarvall commented May 27, 2021 via email

@prculley
Copy link
Contributor

In my opinion, I would not at this point try to fix the column index issue for all classes. Instead I would just fix up check.py table. The reason is that we may be sometime relatively soon doing a large change to the db underpinnings; convert stored data from pickled serialized objects to json objects. If we so this, we would lose the serialized data calls to the db and have to make a lot of changes to code like check.py to deal with this. And a more general method of column indexing would become unnecessary.

I would make the check.py fix for the media and place a separate commit as part of this PR; if you made it a PR on its own, then this would become a dependent PR with potential to get held up. I would not try to satisfy Travis in that commit, but rather deal with it as part of the overall PR. That way you only have to do it once. Additional changes to that table for your new URL would be part of the overall PR commits.

In general, we need to make Travis happy before a PR gets accepted, so you may end up dealing with this more than once, depending on when your PR is accepted.

Regarding your other URL PRs, we are back to the dependency issues, depending on what gets accepted first. I might be inclined to just let them stay 'in progress' until this one is accepted and then fix them up to work, after rebasing them on the master commits that result from this PR.

There are a couple of other significant PRs (place updates, and UIDs) that will also have dependency issues like this; whichever gets accepted first will make a bunch of work for the others to make sure that it all comes out correctly.

@janskarvall
Copy link
Author

janskarvall commented May 27, 2021 via email

@janskarvall
Copy link
Author

I believe that the PR now passes the tests.
If so, what would be my next step with the other "Internet tab added to XX category" PR's?

Should I wait for this one to be merged, then update one of the others? Conflicts will occur on upgrade.py, check.py, and possibly tools_test.py whenever any of them are merged, so I need to rebase the PR branches.

Jan

@prculley
Copy link
Contributor

prculley commented Jun 5, 2021

If it was me, I would wait. Less work, avoiding the merge conflicts multiple times etc. And if there are any other concerns with the way this is done when Nick H reviews, you could make appropriate changes to the others to match.

@PushKK
Copy link
Contributor

PushKK commented Jun 7, 2021

Travis say for you:

gramps/gen/db/upgrade.py:53:    
gramps/gen/db/upgrade.py:61:    
gramps/gen/db/upgrade.py:66:    
gramps/gen/db/upgrade.py:68:    
gramps/gen/db/upgrade.py:82:                 
gramps/gui/editors/editmedia.py:219:        
gramps/plugins/importer/importxml.py:1587:             self.object.add_url(url)           
gramps/plugins/webreport/media.py:615:                
ERROR - Trailing whitespace found in source file(s)

Summary:

gramps/gen/db/upgrade.py:
You must delete whitespaces on row 53 (4 whitespaces = 1 tab).
May be rows 60, 65, 67 and 81 have whitespaces before '#' or 'from'.

gramps/plugins/importer/importxml.py:
Row 1587 have whitespaces on end:
" self.object.add_url(url) "

After change every file Travis run check your code again.
May be you can change your code on this PR on tab 'Files Changed'.

@Nick-Hall
Copy link
Member

I agree with adding urls to all primary objects except for sources and citations. I think that they should be handled slightly differently because an url actually forms part of a citation.

Having said that, I'm about to review all pull requests in light of the release of GEDCOM 7.0 today.

@Nick-Hall
Copy link
Member

@SNoiraud Sorry, I didn't make myself very clear. I just think that they need to be handled slightly differently for citations.

Typically, a citation will only have one url and it will form part of the formatted citation, together with the date that it was accessed. Both these fields should probably be available in the main tab of citation editor. If we used attributes to record such information we could define a special attribute to provide a formatted citation. For example, an attribute called "format" could contain the string "{page} ({url}, accessed: {date})".

In GEDCOM 7.0, the recommendation seems to be to store such information in the PAGE tag.

@janskarvall
Copy link
Author

janskarvall commented Jun 9, 2021 via email

@prculley
Copy link
Contributor

prculley commented Jun 9, 2021

The GEDCOM 7.0 spec does allow URLs as the source of the file for multimedia. So does Gramps, theoretically, although it only works in pretty special circumstances.

@Nick-Hall
Copy link
Member

Closed in favour of implementing web-accessible file references in media objects. See the Gedcom 7.0 FILE tag specification.

@Nick-Hall Nick-Hall closed this Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants