Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

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

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
Nick,


Maybe a possible minor issue on XML attribute (gramps xml)?
Using "name" is maybe too confusing?

Looking at https://github.com/gramps-project/gramps/pull/38
we can see that XML schemas were not updated!

True, our XML schema(s) are currently only documentation files,
but one who would like to use them for validation might
have some problems.

I made tests on an experimental addons
https://github.com/gramps-project/addons-source/commit/65e819a9d08d5150617c6f96d749256f5d2010e2
Adding some comments for validating a gramps XML
via dtd file. :-(

eg,
```diff
+<!--
+<!ELEMENT name (daterange|datespan|dateval|datestr)?>
+-->```
because this element is already used.

Cosmetic, but could be a problem for 3rd party tools or on the future, no?


PS: https://travis-ci.org/gramps-project/addons-source/builds/68191360
What does it means? Same commit on master does not return failure!



--------------------------------------------
En date de : Mer 27.5.15, Nick Hall <[hidden email]> a écrit :

 Objet: Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: "gramps-project/gramps" <[hidden email]>
 Date: Mercredi 27 mai 2015, 14h32
 
 The API is similar to that used
 for personal names.  I decided that using
 place.get_name and place.set_name
 was preferable to place.set_placename and
 place.set_placename.
 
 We don't allow
 person.set_primary_name(first_name='John',
 surname='Smith') either.  Not a bad idea
 though.
 
 —
 Reply to this email directly or view
 it on GitHub.
 
   
     
     
   
   
 
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

Nick Hall
On 24/06/15 18:51, jerome wrote:

> Maybe a possible minor issue on XML attribute (gramps xml)?
> Using "name" is maybe too confusing?
>
> Looking athttps://github.com/gramps-project/gramps/pull/38
> we can see that XML schemas were not updated!
>
> True, our XML schema(s) are currently only documentation files,
> but one who would like to use them for validation might
> have some problems.
>

The DTD and  RELAX NG schema need updating.  I forgot about them.

Do we still need to maintain both the DTD and RELAX NG schema?  I don't
think that there is a problem updating the rng file.

Are you suggesting that we change the Gramps XML so close to the release?


Nick.


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
Maybe!

There is a conflict between:

<!ELEMENT name    (first?, call?, surname*, suffix?, title?, nick?, familynick?, group?,
                  (daterange|datespan|dateval|datestr)?, noteref*, citationref*)>
<!ATTLIST name    
        alt       (0|1) #IMPLIED
        type      CDATA #IMPLIED
        priv      (0|1) #IMPLIED
        sort      CDATA #IMPLIED
        display   CDATA #IMPLIED
>

and something like: # dtd not updated yet

<!--
<!ELEMENT name (daterange|datespan|dateval|datestr)?>
-->
<!ATTLIST name
        lang CDATA #IMPLIED
        value CDATA #REQUIRED
>

on placeobj.


eg, $ xmllint --dtdvalid file://mygrampsxml.dtd --noout --dropdtd test.gramps' # libxml2-utils

will return:
                         
mygrampsxml.dtd:262: validity error : Redefinition of element name
<!ELEMENT name (daterange|datespan|dateval|datestr)?>

True, we use these schema files as documentation (gramps xml spec),
but some XML handlers might return false data.

eg, via ElementTree or lxml, listing available tags on my 'test.gramps'

{http://gramps-project.org/xml/1.7.0/}database
{http://gramps-project.org/xml/1.7.0/}header
{http://gramps-project.org/xml/1.7.0/}created
{http://gramps-project.org/xml/1.7.0/}researcher
{http://gramps-project.org/xml/1.7.0/}placeobj
{http://gramps-project.org/xml/1.7.0/}name
{http://gramps-project.org/xml/1.7.0/}dateval
{http://gramps-project.org/xml/1.7.0/}coord
{http://gramps-project.org/xml/1.7.0/}placeref

I cannot safety use function like:

XPath("//*[local-name() = $name]")

Maybe using name as XML attribute on a primary object (Element),
like for place object on 4.1 does not raise errors because
it is an attribute of place. Now with name as placename tag/element
there is maybe a possible conflict with name into person name?

Note, I am just looking at gramps xml handling, so I am not
a XML expert. I suppose it will be harder to fix it once 4.2.0
is released?

Within Gramps it sounds cosmetic, but this might be a problem
for tools using .gramps. eg, https://github.com/claws/gramps2gource


Jérôme.                                                    

--------------------------------------------
En date de : Mer 24.6.15, Nick Hall <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email]
 Date: Mercredi 24 juin 2015, 22h48
 
 On 24/06/15 18:51, jerome
 wrote:
 > Maybe a possible minor issue on
 XML attribute (gramps xml)?
 > Using
 "name" is maybe too confusing?
 >
 > Looking
 athttps://github.com/gramps-project/gramps/pull/38
 > we can see that XML schemas were not
 updated!
 >
 > True, our
 XML schema(s) are currently only documentation files,
 > but one who would like to use them for
 validation might
 > have some problems.
 >
 
 The DTD
 and  RELAX NG schema need updating.  I forgot about
 them.
 
 Do we still need to
 maintain both the DTD and RELAX NG schema?  I don't
 think that there is a problem updating the rng
 file.
 
 Are you suggesting
 that we change the Gramps XML so close to the release?
 
 
 Nick.
 
 
 ------------------------------------------------------------------------------
 Monitor 25 network devices or servers for free
 with OpManager!
 OpManager is web-based
 network management software that monitors
 network devices and physical & virtual
 servers, alerts via email & sms
 for
 fault. Monitor 25 devices for free with no restriction.
 Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
In reply to this post by jerome
Nick,

Attached patch could be a solution: instead of handling name element
for both person and place, we just use own element (tag, markup) for
place name.


Jérôme.

--------------------------------------------
En date de : Mer 24.6.15, Nick Hall <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email]
 Date: Mercredi 24 juin 2015, 22h48
 
 On 24/06/15 18:51, jerome
 wrote:
 > Maybe a possible minor issue on
 XML attribute (gramps xml)?
 > Using
 "name" is maybe too confusing?
 >
 > Looking
 athttps://github.com/gramps-project/gramps/pull/38
 > we can see that XML schemas were not
 updated!
 >
 > True, our
 XML schema(s) are currently only documentation files,
 > but one who would like to use them for
 validation might
 > have some problems.
 >
 
 The DTD
 and  RELAX NG schema need updating.  I forgot about
 them.
 
 Do we still need to
 maintain both the DTD and RELAX NG schema?  I don't
 think that there is a problem updating the rng
 file.
 
 Are you suggesting
 that we change the Gramps XML so close to the release?
 
 
 Nick.
 
 
 ------------------------------------------------------------------------------
 Monitor 25 network devices or servers for free
 with OpManager!
 OpManager is web-based
 network management software that monitors
 network devices and physical & virtual
 servers, alerts via email & sms
 for
 fault. Monitor 25 devices for free with no restriction.
 Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel

pname.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
In reply to this post by Nick Hall
Yes, only DTD syntax will complain. # syntax
Updated rng file is passing.

About the push request for installation,
schema files seem still valid according to w3c.

http://www.w3.org/standards/xml/schema

but maybe dated technologies?

http://www.w3.org/TR/xmlschema-1/

Anyway, patch could be pushed on master?

And maybe just a possible XML design issue: should we use a common
Element name for two different primary objects?

For info, not the nicest methods, but still get the addon working
with the updated model for gramps xml file.
https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/lxml/lxmlGramplet.py

Also, experimental xsd schema sound more experimental than before!
https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/lxml/grampsxml.xsd

eg, I lost 'sort' and 'display' attributes on name element and get a mixup.
<element name='name'>
  <complexType>
   <sequence>
    <element ref='gramps:first' minOccurs='0' maxOccurs='1'/>
    <element ref='gramps:call' minOccurs='0' maxOccurs='1'/>
    <element ref='gramps:surname' minOccurs='0' maxOccurs='unbounded'/>
    <element ref='gramps:suffix' minOccurs='0' maxOccurs='1'/>
    <element ref='gramps:title' minOccurs='0' maxOccurs='1'/>
    <element ref='gramps:nick' minOccurs='0' maxOccurs='1'/>
    <element ref='gramps:familynick' minOccurs='0' maxOccurs='1'/>
    <element ref='gramps:group' minOccurs='0' maxOccurs='1'/>
    <choice minOccurs='0' maxOccurs='1'>
     <element ref='gramps:daterange'/>
     <element ref='gramps:datespan'/>
     <element ref='gramps:dateval'/>
     <element ref='gramps:datestr'/>
    </choice>
    <element ref='gramps:noteref' minOccurs='0' maxOccurs='unbounded'/>
    <element ref='gramps:citationref' minOccurs='0' maxOccurs='unbounded'/>
   </sequence>
   <attribute name='lang' type='string' use='optional'/>
   <attribute name='value' type='string' use='required'/>
  </complexType>
 </element>

Ignored python classes (samples) via generateDS, for now.

#gramps 41

class nameSub(supermod.name):
    def __init__(self, sort=None, alt=None, type_=None, display=None, priv=None, first=None, call=None, surname=None, suffix=None, title=None, nick=None, familynick=None, group=None, daterange=None, datespan=None, dateval=None, datestr=None, noteref=None, citationref=None):
        super(nameSub, self).__init__(sort, alt, type_, display, priv, first, call, surname, suffix, title, nick, familynick, group, daterange, datespan, dateval, datestr, noteref, citationref, )

Maybe Doug's code on master might have problems with gramps xml files
generated with 4.2 or greater versions?


Jérôme.


--------------------------------------------
En date de : Mer 24.6.15, Nick Hall <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email]
 Date: Mercredi 24 juin 2015, 20h48
 
 On 24/06/15 18:51, jerome
 wrote:
 > Maybe a possible minor issue on
 XML attribute, element (gramps xml)?
 > Using
 "name" is maybe too confusing?
 >
 > Looking
 athttps://github.com/gramps-project/gramps/pull/38
 > we can see that XML schemas were not
 updated!
 >
 > True, our
 XML schema(s) are currently only documentation files,
 > but one who would like to use them for
 validation might
 > have some problems.
 >
 
 The DTD
 and  RELAX NG schema need updating.  I forgot about
 them.
 
 Do we still need to
 maintain both the DTD and RELAX NG schema?  I don't
 think that there is a problem updating the rng
 file.
 
 Are you suggesting
 that we change the Gramps XML so close to the release?
 
 
 Nick.
 
 
 ------------------------------------------------------------------------------
 Monitor 25 network devices or servers for free
 with OpManager!
 OpManager is web-based
 network management software that monitors
 network devices and physical & virtual
 servers, alerts via email & sms
 for
 fault. Monitor 25 devices for free with no restriction.
 Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
Corollary for DTD syntax on name (for person)
     element name: validity error : Element name does not carry attribute value

Also, Elements order seems important on XML schema files.
Fixed order (name/ptitle) on last commit (addon)[1]

About my previous proposed patch (import/export XML), it seems that importing a .gramps generated by 4.1.x is making a "ptitle" migration, right? So, the previous patch was maybe incomplete... Sorry!

At least, I can commit an update for .dtd, .rng files on gramps42 branch and master?

As far I can see the only 'real' difference against files on addon is around relation types.

-        mrel  (None|Birth|Adopted|Stepchild|Sponsored|Foster|Other|Unknown) #IMPLIED
-        frel  (None|Birth|Adopted|Stepchild|Sponsored|Foster|Other|Unknown) #IMPLIED
+        mrel  CDATA #IMPLIED
+        frel  CDATA #IMPLIED

I cannot exactly remember why I did this customization, but it was during tests
some years ago. Looks like custom mrel or frel raised error. Maybe there is a solution
into dtd documentation by adding a generic value into the list? XML documentation is not very friendly!

I suppose I can understand the common "name" logic.
One value, optional lang and date information for place,
name or whatever record object. But the xml naming is our choice,
and current set of tags makes handling gramps xml file a little bit
more difficult and maybe not valid!

Can I commit the update for dtd and rng files?


[1] https://github.com/gramps-project/addons-source/commit/4312ee78c2c25d8e6273c3df669819d3e89cad2d


Jérôme.

--------------------------------------------
En date de : Ven 26.6.15, jerome <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email], "Nick Hall" <[hidden email]>
 Date: Vendredi 26 juin 2015, 8h51
 
 Yes, only DTD syntax will
 complain. # syntax
 Updated rng file is
 passing.
 
 About the push
 request for installation,
 schema files seem
 still valid according to w3c.
 
 http://www.w3.org/standards/xml/schema
 
 but maybe dated
 technologies?
 
 http://www.w3.org/TR/xmlschema-1/
 
 Anyway, patch could be pushed
 on master?
 
 And maybe just a
 possible XML design issue: should we use a common
 Element name for two different primary
 objects?
 
 For info, not the
 nicest methods, but still get the addon working
 with the updated model for gramps xml file.
 https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/lxml/lxmlGramplet.py
 
 Also, experimental xsd schema
 sound more experimental than before!
 https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/lxml/grampsxml.xsd
 
 eg, I lost 'sort' and
 'display' attributes on name element and get a
 mixup.
 <element
 name='name'>
  
 <complexType>
    <sequence>
     <element ref='gramps:first'
 minOccurs='0' maxOccurs='1'/>
     <element ref='gramps:call'
 minOccurs='0' maxOccurs='1'/>
     <element ref='gramps:surname'
 minOccurs='0' maxOccurs='unbounded'/>
     <element ref='gramps:suffix'
 minOccurs='0' maxOccurs='1'/>
     <element ref='gramps:title'
 minOccurs='0' maxOccurs='1'/>
     <element ref='gramps:nick'
 minOccurs='0' maxOccurs='1'/>
     <element
 ref='gramps:familynick' minOccurs='0'
 maxOccurs='1'/>
     <element
 ref='gramps:group' minOccurs='0'
 maxOccurs='1'/>
     <choice
 minOccurs='0' maxOccurs='1'>
      <element
 ref='gramps:daterange'/>
  
    <element
 ref='gramps:datespan'/>
  
    <element
 ref='gramps:dateval'/>
  
    <element
 ref='gramps:datestr'/>
    
 </choice>
     <element
 ref='gramps:noteref' minOccurs='0'
 maxOccurs='unbounded'/>
    
 <element ref='gramps:citationref'
 minOccurs='0' maxOccurs='unbounded'/>
    </sequence>
    <attribute name='lang'
 type='string' use='optional'/>
    <attribute
 name='value' type='string'
 use='required'/>
  
 </complexType>
  </element>
 
 Ignored python classes
 (samples) via generateDS, for now.
 
 #gramps 41
 
 class nameSub(supermod.name):
     def __init__(self, sort=None, alt=None,
 type_=None, display=None, priv=None, first=None, call=None,
 surname=None, suffix=None, title=None, nick=None,
 familynick=None, group=None, daterange=None, datespan=None,
 dateval=None, datestr=None, noteref=None,
 citationref=None):
        
 super(nameSub, self).__init__(sort, alt, type_, display,
 priv, first, call, surname, suffix, title, nick, familynick,
 group, daterange, datespan, dateval, datestr, noteref,
 citationref, )
 
 Maybe
 Doug's code on master might have problems with gramps
 xml files
 generated with 4.2 or greater
 versions?
 
 
 Jérôme.
 
 
 --------------------------------------------
 En date de : Mer 24.6.15, Nick Hall <[hidden email]>
 a écrit :
 
  Objet: Re:
 [Gramps-devel] [gramps] GEPS 036: Add date and language to
 place names (cc6820f)
  À: [hidden email]
  Date: Mercredi 24 juin 2015, 20h48
 
  On 24/06/15 18:51, jerome
  wrote:
  > Maybe a possible
 minor issue on
  XML attribute, element
 (gramps xml)?
  > Using
  "name"
 is maybe too confusing?
  >
  > Looking
 
 athttps://github.com/gramps-project/gramps/pull/38
  > we can see that XML schemas were not
  updated!
  >
  > True, our
  XML schema(s)
 are currently only documentation files,
 
 > but one who would like to use them for
 
 validation might
  > have some
 problems.
  >
 
  The DTD
  and  RELAX NG schema
 need updating.  I forgot about
  them.
 
  Do we still need to
  maintain both the DTD and RELAX NG schema?  I
 don't
  think that there is a problem
 updating the rng
  file.
 
  Are you suggesting
  that we
 change the Gramps XML so close to the release?
 
 
  Nick.
 
 
 
 ------------------------------------------------------------------------------
  Monitor 25 network devices or servers for
 free
  with OpManager!
 
 OpManager is web-based
  network management
 software that monitors
  network devices and
 physical & virtual
  servers, alerts via
 email & sms
  for
 
 fault. Monitor 25 devices for free with no restriction.
  Download now
  http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 
 _______________________________________________
  Gramps-devel mailing list
  [hidden email]
  https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
In reply to this post by Nick Hall
Have an illustration via a gramplet for gramps42.
No need dependency (gramps42 and python3)

1. download:
https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/lxml/etreeGramplet.py
https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/lxml/etreeGramplet.gpr.py
and copy these files into your '$HOME/.gramps/gramps42/plugins' directory

2. Run gramps, call 'etree gramplet' from dashboard and
select either 'example.gramps' or 'data.gramps' from last revision (gramps42.git)
https://github.com/gramps-project/gramps/tree/maintenance/gramps42/example/gramps

3. Execute it and look at your terminal/console (print statement).
Items on name tags have been printed.

Note, .gramps samples (example, data) and XML schema files have been
upgraded and commited on last revisions (gramps42, master).


regards,
Jérôme.

--------------------------------------------
En date de : Mer 24.6.15, Nick Hall <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email]
 Date: Mercredi 24 juin 2015, 20h48
 
 On 24/06/15 18:51, jerome
 wrote:
 > Maybe a possible minor issue on
 XML attribute (gramps xml)?
 > Using
 "name" is maybe too confusing?
 >
 > Looking
 athttps://github.com/gramps-project/gramps/pull/38
 > we can see that XML schemas were not
 updated!
 >
 > True, our
 XML schema(s) are currently only documentation files,
 > but one who would like to use them for
 validation might
 > have some problems.
 >
 
 The DTD
 and  RELAX NG schema need updating.  I forgot about
 them.
 
 Do we still need to
 maintain both the DTD and RELAX NG schema?  I don't
 think that there is a problem updating the rng
 file.
 
 Are you suggesting
 that we change the Gramps XML so close to the release?
 
 
 Nick.
 
 
 ------------------------------------------------------------------------------
 Monitor 25 network devices or servers for free
 with OpManager!
 OpManager is web-based
 network management software that monitors
 network devices and physical & virtual
 servers, alerts via email & sms
 for
 fault. Monitor 25 devices for free with no restriction.
 Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

Helge.Herz-2
I tried it using GrampsAIO64-4.2.0-beta1, the newest data.gramps from
git on Win7 Prof 64 bit German.


it starts well:
From:
 "C:\ProgrammeNeutral\GrampsGIT\GrampsMaster\gramps\example\gramps\data.gramps"
 to:
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etree.xml".
tags 2
events 125
people 60
families 23

...

but than
...
> [('value', 'Denver Co.')]
NAME <Element '{http://gramps-project.org/xml/1.7.0/}name' at
0x000000000aa7bef8
> [('value', 'Washoe Co.')]
2015-06-27 18:49:23.719: ERROR: grampsapp.py: line 107: Unhandled exception
Traceback (most recent call last):
  File
"D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
line 230, in run
    self.ReadXML(entry)
  File
"D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
line 274, in ReadXML
    self.ParseXML(tree, filename)
  File
"D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
line 443, in ParseXML
    start = epoch(last[1])
  File
"D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
line 93, in epoch
    return(fmt).decode('mbcs').encode("utf-8")
AttributeError: 'str' object has no attribute 'decode'

MAy be it's an win encoding issue.
-Helge

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
Ah, yes, thanks!

It looks like Windows stuff for handling time (date format)?

I do not have Windows, but I removed everything arounds codecs
or utf-8 and I trusted python3/byte for the lxml gramplet.
Maybe we do not need this line anymore with python3?

Did you try to only return fmt?

fmt = conv.strftime('%d %B %Y') # sorry, I was not able to find a common one!

Also, there was a minor issue if one tests this gramplet with an opened
Family Tree...

@@ -487,7 +487,7 @@ def change(self):
         
     def _getPersonTimestamp(self, person_handle):
-        timestamp = self.dbstate.db.person_map.get(str(person_handle))[17]
+       timestamp = self.dbstate.db.person_map.get(person_handle)[17]
         return timestamp

Fixed on

https://github.com/gramps-project/addons-source/commit/6aa4604b56d8a263d237abba2651d26eba394fb1


--------------------------------------------
En date de : Sam 27.6.15, Helge.Herz <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email]
 Date: Samedi 27 juin 2015, 17h06
 
 I tried it using
 GrampsAIO64-4.2.0-beta1, the newest data.gramps from
 git on Win7 Prof 64 bit German.
 
 
 it starts
 well:
 From:
 
 "C:\ProgrammeNeutral\GrampsGIT\GrampsMaster\gramps\example\gramps\data.gramps"
  to:
 
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etree.xml".
 tags 2
 events 125
 people 60
 families 23
 
 ...
 
 but than
 ...
 > [('value', 'Denver
 Co.')]
 NAME <Element '{http://gramps-project.org/xml/1.7.0/}name'
 at
 0x000000000aa7bef8
 >
 [('value', 'Washoe Co.')]
 2015-06-27 18:49:23.719: ERROR: grampsapp.py:
 line 107: Unhandled exception
 Traceback
 (most recent call last):
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 230, in run
    
 self.ReadXML(entry)
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 274, in ReadXML
    
 self.ParseXML(tree, filename)
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 443, in ParseXML
    
 start = epoch(last[1])
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 93, in epoch
    
 return(fmt).decode('mbcs').encode("utf-8")
 AttributeError: 'str' object has no
 attribute 'decode'
 
 MAy be it's an win encoding issue.
 -Helge
 
 ------------------------------------------------------------------------------
 Monitor 25 network devices or servers for free
 with OpManager!
 OpManager is web-based
 network management software that monitors
 network devices and physical & virtual
 servers, alerts via email & sms
 for
 fault. Monitor 25 devices for free with no restriction.
 Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

jerome
In reply to this post by Helge.Herz-2
Note, if you play with number of last edited records
(dynamic option on the gramplet),
then you should not set 'self.last = 1'...

Can be easily fixed. eg:

def build_options(self):
        from gramps.gen.plug.menu import NumberOption
        self.add_option(NumberOption(_("Number of editions back"),
-                                     self.last, 1, 5000))
+                                    self.last, 2, 5000))

Months are properly displayed under my config (even with self.last = 5000).

Anyway, this addon upgrade was rather an illustration of the possible
problems with current <name> tag on gramps xml.


Jérôme



--------------------------------------------
En date de : Sam 27.6.15, Helge.Herz <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] [gramps] GEPS 036: Add date and language to place names (cc6820f)
 À: [hidden email]
 Date: Samedi 27 juin 2015, 17h06
 
 I tried it using
 GrampsAIO64-4.2.0-beta1, the newest data.gramps from
 git on Win7 Prof 64 bit German.
 
 
 it starts
 well:
 From:
 
 "C:\ProgrammeNeutral\GrampsGIT\GrampsMaster\gramps\example\gramps\data.gramps"
  to:
 
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etree.xml".
 tags 2
 events 125
 people 60
 families 23
 
 ...
 
 but than
 ...
 > [('value', 'Denver
 Co.')]
 NAME <Element '{http://gramps-project.org/xml/1.7.0/}name'
 at
 0x000000000aa7bef8
 >
 [('value', 'Washoe Co.')]
 2015-06-27 18:49:23.719: ERROR: grampsapp.py:
 line 107: Unhandled exception
 Traceback
 (most recent call last):
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 230, in run
    
 self.ReadXML(entry)
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 274, in ReadXML
    
 self.ParseXML(tree, filename)
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 443, in ParseXML
    
 start = epoch(last[1])
   File
 "D:\GRAMPS_test\ZZ_Gramps34_64Bit_Python3\gramps\gramps42\plugins\lxml\etreeGramplet.py",
 line 93, in epoch
    
 return(fmt).decode('mbcs').encode("utf-8")
 AttributeError: 'str' object has no
 attribute 'decode'
 
 MAy be it's an win encoding issue.
 -Helge
 
 ------------------------------------------------------------------------------
 Monitor 25 network devices or servers for free
 with OpManager!
 OpManager is web-based
 network management software that monitors
 network devices and physical & virtual
 servers, alerts via email & sms
 for
 fault. Monitor 25 devices for free with no restriction.
 Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gramps] GEPS 036: Add date and language to place names (cc6820f)

Helge.Herz-2
In reply to this post by jerome
Am 27.06.2015 19:37, schrieb jerome:
> Ah, yes, thanks!
>
> It looks like Windows stuff for handling time (date format)?
>
> I do not have Windows, but I removed everything arounds codecs
> or utf-8 and I trusted python3/byte for the lxml gramplet.
> Maybe we do not need this line anymore with python3?
>
> Did you try to only return fmt?

This works fine for me:

@@ -89,10 +89,7 @@ def epoch(t):
             conv = datetime.fromtimestamp(date)
             fmt = conv.strftime('%d %B %Y')

-        if os.name == 'nt':
-            return(fmt).decode('mbcs').encode("utf-8")
-        else:
-            return(fmt)
+        return(fmt)

Helge

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel