Statistics Gramplet in v5.0

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Statistics Gramplet in v5.0

Brad Rogers
Hello,

Just upgraded to v5.0 (thanks to all involved in creating and getting it
ready for release) and notice that the statistics gramplet isn't as
'complete' as the version used in v4.2.x.  It misses the Disconnected,
Without Birthdate and Incomplete Names elements.  Maybe others, but
those are the ones I noticed.  Admittedly, they're not essential to using
Gramps, but do make certain things easier.

I tried copying statsgramplet.py from v4.2.8 over the v5 one, but it
doesn't run correctly;  It prints 'Processing....' to the screen, and
proceeds no further.  Not being a programmer, I didn't fiddle any
further, and reinstated the v5 copy of statsgramplet.py

My question being, is this a deliberate change or an oversight?

--
 Regards  _
         / )           "The blindingly obvious is
        / _)rad        never immediately apparent"
I'm spending all my money and it's going up my nose
Teenage Depression - Eddie & The Hot Rods

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Statistics Gramplet in v5.0

prculley
The Statistics Gramplet was deliberately simplified.  I suspect that this was due to the fact that it used to do a complete scan of the database every time something changed.  This would have made Gramps rather sluggish on large databases.  The items that remain are already stored in the database, and are quickly accessed.

It appears that there was also a bug introduced by this change; the "Total number of media object references" is incorrect.  We may want to fix this and rethink the 'simplifying' change.

The 4.2 version of the addon can be made to run with a few changes.  If you compare the 4.2 and 5.0 versions of the addon, you will note that there are the following lines (at line 85 in 4.2):
        mobjects = database.get_number_of_media_objects()
        mbytes = "0"
        for media in database.iter_media_objects():
and at line 79 in 5.0;
        mobjects = database.get_number_of_media()
        mbytes = "0"
        for media in database.iter_media():

If you copy the 4.2 version of the plugin to the Gramps 5.0 location and change those line to be like the original 5.0 version (get rid of the "_objects" in two places), then the Gramps 4.2 version of the Gramplet should work as it did in Gramps4.2.8.

Paul C.

On Mon, Jul 30, 2018 at 4:41 AM Brad Rogers <[hidden email]> wrote:
Hello,

Just upgraded to v5.0 (thanks to all involved in creating and getting it
ready for release) and notice that the statistics gramplet isn't as
'complete' as the version used in v4.2.x.  It misses the Disconnected,
Without Birthdate and Incomplete Names elements.  Maybe others, but
those are the ones I noticed.  Admittedly, they're not essential to using
Gramps, but do make certain things easier.

I tried copying statsgramplet.py from v4.2.8 over the v5 one, but it
doesn't run correctly;  It prints 'Processing....' to the screen, and
proceeds no further.  Not being a programmer, I didn't fiddle any
further, and reinstated the v5 copy of statsgramplet.py

My question being, is this a deliberate change or an oversight?

--
 Regards  _
         / )           "The blindingly obvious is
        / _)rad        never immediately apparent"
I'm spending all my money and it's going up my nose
Teenage Depression - Eddie & The Hot Rods
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: Statistics Gramplet in v5.0

Brad Rogers
On Fri, 3 Aug 2018 09:22:29 -0500
Paul Culley <[hidden email]> wrote:

Hello Paul,

>The Statistics Gramplet was deliberately simplified.  I suspect that
>this was due to the fact that it used to do a complete scan of the
>database every time something changed.  This would have made Gramps
>rather sluggish on large databases.  The items that remain are already

Something I hadn't noticed;  My databases aren't that large.  Yet.

Not being a programmer, I have no idea how easy/hard it would be to
change the Stats Gramplet to only run when it's viewed, rather than
after every change to the database.  The 'Processing' notice would still
exist indicating that the necessary calculations are being done, of
course.

>It appears that there was also a bug introduced by this change; the
>"Total number of media object references" is incorrect.  We may want to

I hadn't noticed that.  But thanks for the info.

>fix this and rethink the 'simplifying' change.

>The 4.2 version of the addon can be made to run with a few changes.  If

Thank you for detailing the required changes.  Now implemented here.
I'll keep a backup copy of the modified 4.2.8 statsgramplet to copy over
the v5.0 one should it be necessary after any future Gramps upgrade.

Thank you once again Paul, for detailing the changes, their reasons,
and how to rework the old version to work with Gramps v5.  Most helpful.

--
 Regards  _
         / )           "The blindingly obvious is
        / _)rad        never immediately apparent"
It's only bits of plastic, lines projected on the wall
Keep It Clean - The Vibrators

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org

attachment0 (499 bytes) Download Attachment