[PATCH 3 of 3 eac] [dataimport] Fix error message when target isn't specified by xlink:href

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Apr 14 15:31:08 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1492176260 -7200
#      Fri Apr 14 15:24:20 2017 +0200
# Node ID 95731cf6334ca719a3ef0cac0740bce8715510bc
# Parent  75de74eba67906a6c75e9021858e52bdc2d86c04
[dataimport] Fix error message when target isn't specified by xlink:href


The attribute name is href in the xlink namespace, not xlink.

diff --git a/cubicweb_eac/dataimport.py b/cubicweb_eac/dataimport.py
--- a/cubicweb_eac/dataimport.py
+++ b/cubicweb_eac/dataimport.py
@@ -779,11 +779,11 @@ class EACCPFImporter(object):
                 line=elem.sourceline)
             return
         obj_uri = elem.attrib.get('{%(xlink)s}href' % self.namespaces)
         if not obj_uri:
             self.import_log.record_warning(self._('found a cpfRelation without any object (no '
-                                                  'xlink attribute), skipping'),
+                                                  'xlink:href attribute), skipping'),
                                            line=elem.sourceline)
             return
         yield external_uri(obj_uri)
         values = {agent_role: set([self.record.extid]), other_role: set([obj_uri])}
         rentry = self._elem_find(elem, 'eac:relationEntry')
@@ -802,11 +802,11 @@ class EACCPFImporter(object):
         ExternalUri entities).
         """
         obj_uri = elem.attrib.get('{%(xlink)s}href' % self.namespaces)
         if obj_uri is None:
             self.import_log.record_warning(self._(
-                'found a resourceRelation without any object (no xlink '
+                'found a resourceRelation without any object (no xlink:href '
                 'attribute), skipping'), line=elem.sourceline)
             return
         yield external_uri(obj_uri)
         values = {
             'resource_relation_resource': set([obj_uri]),
diff --git a/cubicweb_eac/i18n/en.po b/cubicweb_eac/i18n/en.po
--- a/cubicweb_eac/i18n/en.po
+++ b/cubicweb_eac/i18n/en.po
@@ -853,15 +853,17 @@ msgstr "form variant"
 
 msgctxt "NameEntry"
 msgid "form_variant"
 msgstr ""
 
-msgid "found a cpfRelation without any object (no xlink attribute), skipping"
+msgid ""
+"found a cpfRelation without any object (no xlink:href attribute), skipping"
 msgstr ""
 
 msgid ""
-"found a resourceRelation without any object (no xlink attribute), skipping"
+"found a resourceRelation without any object (no xlink:href attribute), "
+"skipping"
 msgstr ""
 
 #, python-format
 msgid "found an unsupported %s attribute in date element %%(e)s"
 msgstr ""
diff --git a/cubicweb_eac/i18n/fr.po b/cubicweb_eac/i18n/fr.po
--- a/cubicweb_eac/i18n/fr.po
+++ b/cubicweb_eac/i18n/fr.po
@@ -859,20 +859,22 @@ msgstr "variante"
 
 msgctxt "NameEntry"
 msgid "form_variant"
 msgstr ""
 
-msgid "found a cpfRelation without any object (no xlink attribute), skipping"
+msgid ""
+"found a cpfRelation without any object (no xlink:href attribute), skipping"
 msgstr ""
-"une cpfRelation sans objet (pas d'attribut xlink) a été trouvée, elle est "
-"ignorée"
+"une cpfRelation sans objet (pas d'attribut xlink:href) a été trouvée, elle "
+"est ignorée"
 
 msgid ""
-"found a resourceRelation without any object (no xlink attribute), skipping"
+"found a resourceRelation without any object (no xlink:href attribute), "
+"skipping"
 msgstr ""
-"une resourceRelation sans objet (pas d'attribut xlink) a été trouvée, elle "
-"est ignorée"
+"une resourceRelation sans objet (pas d'attribut xlink:href) a été trouvée, "
+"elle est ignorée"
 
 #, python-format
 msgid "found an unsupported %s attribute in date element %%(e)s"
 msgstr "attribut %s non supporté dans l'élément data %%(e)s"
 


More information about the saem-devel mailing list