src/pds_doi_service/core/actions/update.py
def run(self, **kwargs):
        """
        Receives a number of input label locations from which to create a
        draft Data Object Identifier (DOI). Each location may be a local directory
        or file path, or a remote HTTP address to the input XML PDS4 label file.

        Parameters
        ----------
        kwargs : dict
            Contains the arguments for the Draft action as parsed from the
            command-line.

        Raises
        ------
        ValueError
            If the provided arguments are invalid.

        """
        updated_dois = []

        self.parse_arguments(kwargs)

        try:
            dois = self._parse_input(self._input)
            dois = self._update_dois(dois)
            dois = self._complete_dois(dois)
            dois = self._validate_dois(dois)

            for doi in dois:
                transaction = self.m_transaction_builder.prepare_transaction(
                    self._submitter,
                    doi,
                    input_path=doi.input_source,
                    output_content_type=CONTENT_TYPE_JSON,
                )

                transaction.log()

                updated_dois.append(doi)
        # Propagate input format exceptions, force flag should not affect
        # these being raised and certain callers (such as the API) look
        # for this exception specifically
        except InputFormatException as err:
            raise err
        # If we catch this exception, it means validation produced a warning
        # and the --force flag is not set, so log the error and exit without
        # producing an output label
        except WarningDOIException as err:
            logger.error(str(err))
            raise err
        # Convert all other errors into a CriticalDOIException to report back
        except Exception as err:
            raise CriticalDOIException(str(err))

        # Create the return output label containing records for all updated DOI's
        # Note this action always returns JSON format to ensure interoperability
        # between the potential service providers
        output_label = self._record_service.create_doi_record(updated_dois, content_type=CONTENT_TYPE_JSON)

        return output_label

        Receives a number of input label locations from which to create a
        draft Data Object Identifier (DOI). Each location may be a local directory
        or file path, or a remote HTTP address to the input XML PDS4 label file.

        Parameters
        ----------
        kwargs : dict
            Contains the arguments for the Draft action as parsed from the
            command-line.

        Raises
        ------
        ValueError
            If the provided arguments are invalid.

        
Receives a number of input label locations from which to create a
draft Data Object Identifier (DOI). Each location may be a local directory
or file path, or a remote HTTP address to the input XML PDS4 label file.

Parameters

kwargs : dict
Contains the arguments for the Draft action as parsed from the
command-line.

Raises

ValueError
If the provided arguments are invalid.
Receives a number of input label locations from which to create a draft Data Object Identifier ( DOI ) . Each location may be a local directory or file path or a remote HTTP address to the input XML PDS4 label file . Parameters kwargs : dict Contains the arguments for the Draft action as parsed from the command - line . Raises ValueError If the provided arguments are invalid .
def run(self, **kwargs):
        updated_dois = []
        self.parse_arguments(kwargs)
        try:
            dois = self._parse_input(self._input)
            dois = self._update_dois(dois)
            dois = self._complete_dois(dois)
            dois = self._validate_dois(dois)
            for doi in dois:
                transaction = self.m_transaction_builder.prepare_transaction(
                    self._submitter,
                    doi,
                    input_path=doi.input_source,
                    output_content_type=CONTENT_TYPE_JSON,
                )
                transaction.log()
                updated_dois.append(doi)
        except InputFormatException as err:
            raise err
        except WarningDOIException as err:
            logger.error(str(err))
            raise err
        except Exception as err:
            raise CriticalDOIException(str(err))
        output_label = self._record_service.create_doi_record(updated_dois, content_type=CONTENT_TYPE_JSON)
        return output_label
def run ( self , ** kwargs ) : updated_dois = [ ] self . parse_arguments ( kwargs ) try : dois = self . _parse_input ( self . _input ) dois = self . _update_dois ( dois ) dois = self . _complete_dois ( dois ) dois = self . _validate_dois ( dois ) for doi in dois : transaction = self . m_transaction_builder . prepare_transaction ( self . _submitter , doi , input_path = doi . input_source , output_content_type = CONTENT_TYPE_JSON , ) transaction . log ( ) updated_dois . append ( doi ) except InputFormatException as err : raise err except WarningDOIException as err : logger . error ( str ( err ) ) raise err except Exception as err : raise CriticalDOIException ( str ( err ) ) output_label = self . _record_service . create_doi_record ( updated_dois , content_type = CONTENT_TYPE_JSON ) return output_label
Receives a number of input label locations from which to create a
draft Data Object Identifier (DOI).
Receives a number of input label locations from which to create a draft Data Object Identifier ( DOI ) .
"""
        Receives a number of input label locations from which to create a
        draft Data Object Identifier (DOI). Each location may be a local directory
        or file path, or a remote HTTP address to the input XML PDS4 label file.

        Parameters
        ----------
        kwargs : dict
            Contains the arguments for the Draft action as parsed from the
            command-line.

        Raises
        ------
        ValueError
            If the provided arguments are invalid.

        """ # Propagate input format exceptions, force flag should not affect # these being raised and certain callers (such as the API) look # for this exception specifically # If we catch this exception, it means validation produced a warning # and the --force flag is not set, so log the error and exit without # producing an output label # Convert all other errors into a CriticalDOIException to report back # Create the return output label containing records for all updated DOI's # Note this action always returns JSON format to ensure interoperability # between the potential service providers
self