[PATCH eac V2] Read either standardDate attribute or inner text when parsing maintenanceEvent tag

Frank Bessou frank.bessou at logilab.fr
Thu Sep 5 16:15:11 CEST 2019


Applied, thanks :)

On 05/09/2019 11:20, Frank Bessou wrote:
> # HG changeset patch
> # User Guillaume Vandevelde <gvandevelde at logilab.fr>
> # Date 1567675082 -7200
> #      Thu Sep 05 11:18:02 2019 +0200
> # Node ID be2cf56106457b8bd6440330d5f72e867070435e
> # Parent  9665e8aad5fd778deb605c88e378bf8cfdb9d8cd
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r be2cf5610645
> Read either standardDate attribute or inner text when parsing maintenanceEvent tag
> 
> diff --git a/cubicweb_eac/dataimport.py b/cubicweb_eac/dataimport.py
> --- a/cubicweb_eac/dataimport.py
> +++ b/cubicweb_eac/dataimport.py
> @@ -1098,7 +1098,7 @@ class EACCPFImporter(object):
>               values['type'] = set([event_type])
>           date = self._elem_find(elem, 'eac:eventDateTime')
>           if date is not None:
> -            dtattr = date.attrib.get('standardDateTime')
> +            dtattr = date.attrib.get('standardDateTime', date.text)
>               if dtattr:
>                   try:
>                       event_date = parse_date(dtattr)
> 

-- 
Frank Bessou
Logilab         https://www.logilab.fr



More information about the saem-devel mailing list