LastChangeReport

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

LastChangeReport

paul womack
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).

I have got as far as this, on the command line:
gramps -O wiseman -a report -p "name=LastChangeReport,linechars=200,of=/home/bugbear/last.txt"

In the GUI, last change allows the selection of the data types (tables) to be reported on;
for my purpose, I obviously want "all of them".

This command:
gramps -O wiseman -a report -p "name=LastChangeReport,show=all"

Shows all the options to the command line LastChangeReport; the output is:
    Available options:
       css               CSS filename to use, html format only (=css filename)
       linechars         The number of characters per line ()
       of                Output file name. MANDATORY (=filename)
       off               Output file format. (=format)
       papermb           Bottom paper margin (=number)
       paperml           Left paper margin (=number)
       papermr           Right paper margin (=number)
       papermt           Top paper margin (=number)
       papero            Paper orientation number. (=number)
       papers            Paper size name. (=name)
       style             Style name. (=name)
       what_types         ()
    Use 'show=option' to see description and acceptable values

I have not managed to find what the parameters to "what_types" should look like. Can anyone help?

  BugBear

------------------------------------------------------------------------------
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: LastChangeReport

Ron Johnson
On 11/17/2017 04:17 AM, paul womack wrote:
> I would like to create some scripts to support a good backing
> up/multi-site synching
> mode of working.
>
> The LastChangeReport will be key to this; by comparing the dates
> of the most recent change in a database, and the datastamp (coded in the
> name) of a backup, I can make the decision as to wether a backup
> needs to be made (or wether a backup needs to be loaded over the top
> of a database).

That's a great idea!

--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
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: LastChangeReport

prculley
what_types should be one or more of 'People', 'Families', 'Events', 'Places', 'Media', or 'Sources'.  If you are running Gramps in another language, these words need to be translated, and are the same as the words on the "Report Options" buttons from the same report in the GUI.

Paul Culley

On Fri, Nov 17, 2017 at 8:03 AM, Ron Johnson <[hidden email]> wrote:
On 11/17/2017 04:17 AM, paul womack wrote:
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).

That's a great idea!

--
World Peace Through Nuclear Pacification



------------------------------------------------------------------------------
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: LastChangeReport

paul womack
Paul Culley wrote:
> what_types should be one or more of 'People', 'Families', 'Events', 'Places', 'Media', or 'Sources'.  If you are running Gramps in another language, these words need to be translated, and are the same as the words on the "Report Options" buttons from the same report in the GUI.
>
> Paul Culley

What's the syntax, either for single or multiple?

I tried this ("diss bread" is a real database!)

gramps -O "diss bread" -a report -p "name=LastChangeReport,linechars=200,what_types=People,off=txt,of=/home/bugbear/last.txt"

And got:

Failed to write report.
Last Change Report
You must select at least one type of record.
Cleaning up.
Exiting.

I'm running Linux.

   BugBear

------------------------------------------------------------------------------
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: LastChangeReport

Ron Johnson
In reply to this post by paul womack
On 11/17/2017 04:17 AM, paul womack wrote:

> I would like to create some scripts to support a good backing
> up/multi-site synching
> mode of working.
>
> The LastChangeReport will be key to this; by comparing the dates
> of the most recent change in a database, and the datastamp (coded in the
> name) of a backup, I can make the decision as to wether a backup
> needs to be made (or wether a backup needs to be loaded over the top
> of a database).
>

Unfortunately, the report only shows the date portion.  Thus, the code would
have to be modified to add the time portion.  (It shouldn't be too hard.)


                            Last Change Report

People Changed

ID        Person                              Changed On


1  I09675    Kemp, Edward                        10 November 2017

2  I00960    Lockwood, Haley                     10 November 2017

3  I09671    Garland, Peter                      30 October 2017



--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
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: LastChangeReport

Ron Johnson
In reply to this post by paul womack
On 11/18/2017 08:59 AM, Ron Johnson wrote:
On 11/17/2017 04:17 AM, paul womack wrote:
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).


Unfortunately, the report only shows the date portion.  Thus, the code would have to be modified to add the time portion.  (It shouldn't be too hard.)


It looks like set_yr_mon_day in function _convert_date  of .gramps/gramps42/plugins/LastChange/LastChangeReport.py should be changed, but I don't know what to change it to.


    def _convert_date(self, date_in):
        """Convert the change date to the preferred date format and return a string"""
        change_date = Date()
        change_date.set_yr_mon_day(*time.localtime(date_in)[0:3])
        return gramps.gen.datehandler.displayer.display(change_date)



                           Last Change Report

People Changed

ID        Person                              Changed On


1  I09675    Kemp, Edward                        10 November 2017

2  I00960    Lockwood, Haley                     10 November 2017

3  I09671    Garland, Peter                      30 October 2017





-- 
World Peace Through Nuclear Pacification

------------------------------------------------------------------------------
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: LastChangeReport

prculley
I am in the process of updating this Gramplet and the report. It will have full-time as well as the date.

Paul Culley 

On Nov 18, 2017 9:22 AM, "Ron Johnson" <[hidden email]> wrote:
On 11/18/2017 08:59 AM, Ron Johnson wrote:
On 11/17/2017 04:17 AM, paul womack wrote:
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).


Unfortunately, the report only shows the date portion.  Thus, the code would have to be modified to add the time portion.  (It shouldn't be too hard.)


It looks like set_yr_mon_day in function _convert_date  of .gramps/gramps42/plugins/LastChange/LastChangeReport.py should be changed, but I don't know what to change it to.


    def _convert_date(self, date_in):
        """Convert the change date to the preferred date format and return a string"""
        change_date = Date()
        change_date.set_yr_mon_day(*time.localtime(date_in)[0:3])
        return gramps.gen.datehandler.displayer.display(change_date)



                           Last Change Report

People Changed

ID        Person                              Changed On


1  I09675    Kemp, Edward                        10 November 2017

2  I00960    Lockwood, Haley                     10 November 2017

3  I09671    Garland, Peter                      30 October 2017





-- 
World Peace Through Nuclear Pacification

------------------------------------------------------------------------------
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: LastChangeReport

Ron Johnson
In reply to this post by Ron Johnson

+1

Is there an immediate one line change that I can make now, though, to output the date in format "%F %T"


On 11/18/2017 01:04 PM, Paul Culley wrote:
I am in the process of updating this Gramplet and the report. It will have full-time as well as the date.

Paul Culley 

On Nov 18, 2017 9:22 AM, "Ron Johnson" <[hidden email]> wrote:
On 11/18/2017 08:59 AM, Ron Johnson wrote:
On 11/17/2017 04:17 AM, paul womack wrote:
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).


Unfortunately, the report only shows the date portion.  Thus, the code would have to be modified to add the time portion.  (It shouldn't be too hard.)


It looks like set_yr_mon_day in function _convert_date  of .gramps/gramps42/plugins/LastChange/LastChangeReport.py should be changed, but I don't know what to change it to.


    def _convert_date(self, date_in):
        """Convert the change date to the preferred date format and return a string"""
        change_date = Date()
        change_date.set_yr_mon_day(*time.localtime(date_in)[0:3])
        return gramps.gen.datehandler.displayer.display(change_date)



                           Last Change Report

People Changed

ID        Person                              Changed On


1  I09675    Kemp, Edward                        10 November 2017

2  I00960    Lockwood, Haley                     10 November 2017

3  I09671    Garland, Peter                      30 October 2017

-- 
World Peace Through Nuclear Pacification

------------------------------------------------------------------------------
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: LastChangeReport

prculley
I just updated the Gramps 4.2.x repository for Addons with an Updated LastChange Gramplet (which should resolve the crash issue with 4.2.6) and an updated Last Change Report (which has date and time of last change, and now includes notes and citations).

You should be able to get it via an Edit/Preferences/Check now, with "Check for updates" set to look for updates, and 'Do not ask about previously notified addons' deselected.

Paul C.

On Sat, Nov 18, 2017 at 4:33 PM, Ron Johnson <[hidden email]> wrote:

+1

Is there an immediate one line change that I can make now, though, to output the date in format "%F %T"


On 11/18/2017 01:04 PM, Paul Culley wrote:
I am in the process of updating this Gramplet and the report. It will have full-time as well as the date.

Paul Culley 

On Nov 18, 2017 9:22 AM, "Ron Johnson" <[hidden email]> wrote:
On 11/18/2017 08:59 AM, Ron Johnson wrote:
On 11/17/2017 04:17 AM, paul womack wrote:
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).


Unfortunately, the report only shows the date portion.  Thus, the code would have to be modified to add the time portion.  (It shouldn't be too hard.)


It looks like set_yr_mon_day in function _convert_date  of .gramps/gramps42/plugins/LastChange/LastChangeReport.py should be changed, but I don't know what to change it to.


    def _convert_date(self, date_in):
        """Convert the change date to the preferred date format and return a string"""
        change_date = Date()
        change_date.set_yr_mon_day(*time.localtime(date_in)[0:3])
        return gramps.gen.datehandler.displayer.display(change_date)



                           Last Change Report

People Changed

ID        Person                              Changed On


1  I09675    Kemp, Edward                        10 November 2017

2  I00960    Lockwood, Haley                     10 November 2017

3  I09671    Garland, Peter                      30 October 2017

-- 
World Peace Through Nuclear Pacification

------------------------------------------------------------------------------
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: LastChangeReport

Ron Johnson
In reply to this post by Ron Johnson
Thanks.

It''s still broken from the CLI, though, and -- in fact -- less info is shown now (previously, the top 10 of all types were listed, and now only the top 10 persons are listed).

$ gramps -O Johnson-Gilbert -a report -p "name=LastChangeReport,show=what_types"
[snip]
Opened successfully!
Performing action: report.
Using options string: name=LastChangeReport,show=what_types
   Available values are:
      what_types     ()
     
Cleaning up.
Exiting.

$ gramps -O Johnson-Gilbert -a report -p "name=LastChangeReport,linechars=100,of=last.txt"
[snip]
Opened successfully!
Performing action: report.
Using options string: name=LastChangeReport,linechars=100,of=last.txt
Cleaning up.
Exiting.


On 11/19/2017 01:40 PM, Paul Culley wrote:
I just updated the Gramps 4.2.x repository for Addons with an Updated LastChange Gramplet (which should resolve the crash issue with 4.2.6) and an updated Last Change Report (which has date and time of last change, and now includes notes and citations).

You should be able to get it via an Edit/Preferences/Check now, with "Check for updates" set to look for updates, and 'Do not ask about previously notified addons' deselected.

Paul C.

On Sat, Nov 18, 2017 at 4:33 PM, Ron Johnson <[hidden email]> wrote:

+1

Is there an immediate one line change that I can make now, though, to output the date in format "%F %T"


On 11/18/2017 01:04 PM, Paul Culley wrote:
I am in the process of updating this Gramplet and the report. It will have full-time as well as the date.

Paul Culley 

On Nov 18, 2017 9:22 AM, "Ron Johnson" <[hidden email]> wrote:
On 11/18/2017 08:59 AM, Ron Johnson wrote:
On 11/17/2017 04:17 AM, paul womack wrote:
I would like to create some scripts to support a good backing up/multi-site synching
mode of working.

The LastChangeReport will be key to this; by comparing the dates
of the most recent change in a database, and the datastamp (coded in the
name) of a backup, I can make the decision as to wether a backup
needs to be made (or wether a backup needs to be loaded over the top
of a database).


Unfortunately, the report only shows the date portion.  Thus, the code would have to be modified to add the time portion.  (It shouldn't be too hard.)


It looks like set_yr_mon_day in function _convert_date  of .gramps/gramps42/plugins/LastChange/LastChangeReport.py should be changed, but I don't know what to change it to.


    def _convert_date(self, date_in):
        """Convert the change date to the preferred date format and return a string"""
        change_date = Date()
        change_date.set_yr_mon_day(*time.localtime(date_in)[0:3])
        return gramps.gen.datehandler.displayer.display(change_date)



                           Last Change Report

People Changed

ID        Person                              Changed On


1  I09675    Kemp, Edward                        10 November 2017

2  I00960    Lockwood, Haley                     10 November 2017

3  I09671    Garland, Peter                      30 October 2017

-- 
World Peace Through Nuclear Pacification

------------------------------------------------------------------------------
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

last.txt (2K) Download Attachment