[PATCH 07 of 13 saem_ref] [seda] Ensure URLs generated for different SEDA versions are consistent

Denis Laxalde denis.laxalde at logilab.fr
Mon Apr 10 13:26:58 CEST 2017


Sylvain Thenault a écrit :
> # HG changeset patch
> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
> # Date 1490888010 -7200
> #      Thu Mar 30 17:33:30 2017 +0200
> # Node ID 0085787efc555d0f99e2fbdace6f42e2aea828c6
> # Parent  85982216f0b9c4d28573bbbd4fcef44c1324ac8e
> [seda] Ensure URLs generated for different SEDA versions are consistent
>
> Related to extranet #15934739

 From reading the commit message or the code, I can't tell how this is
more consistent than before.
At a first glance, I have no clue about what those staticmethod
definitions are for. Having a second look, I may understand that this
cube overrides SEDA2ExportAdapter, in which case subclassing would make
things clearer IMHO.

> diff --git a/cubicweb_saem_ref/entities/seda.py b/cubicweb_saem_ref/entities/seda.py
> --- a/cubicweb_saem_ref/entities/seda.py
> +++ b/cubicweb_saem_ref/entities/seda.py
> @@ -22,18 +22,18 @@ from cubicweb.predicates import is_insta
>
>  from cubes.oaipmh import MetadataFormat
>  from cubes.oaipmh.entities import OAISetSpec
>  from cubicweb_seda.entities import SEDAArchiveTransferIClonableAdapter
>  from cubicweb_seda.entities.custom import SEDAArchiveTransfer
> -from cubicweb_seda.entities.profile_generation import SEDA1XSDExport
> +from cubicweb_seda.entities.profile_generation import SEDA2ExportAdapter, SEDA1XSDExport
>  from cubicweb_seda.views import export
>
>  from .. import cwuri_url
>  from . import oai
>
>
> -SEDA1XSDExport.cwuri_url = staticmethod(cwuri_url)
> +SEDA2ExportAdapter.cwuri_url = staticmethod(cwuri_url)
>
>
>  # hijack xsd_archival_agreement to insert profile as well. Use a monkey-patch rather than new
>  # implementation to avoid doing it twice, once for SEDA 1 another for SEDA 0.2
>



More information about the saem-devel mailing list