Example #1
0
 def check_for_unused_keyword_arguments(self, kwargs_dict):
     ignore_unrecognized_keyword_arguments = kwargs_dict.pop("ignore_unrecognized_keyword_arguments", False)
     attach_taxon_namespace, taxon_namespace = taxonmodel.process_attached_taxon_namespace_directives(kwargs_dict)
     if attach_taxon_namespace or (taxon_namespace is not None):
         self.attached_taxon_namespace = taxon_namespace
     if kwargs_dict and not ignore_unrecognized_keyword_arguments:
         raise TypeError("Unrecognized or unsupported arguments: {}".format(kwargs_dict))
Example #2
0
    def _process_taxon_namespace_directives(self, kwargs_dict):
        """
        The following idioms are supported:

            `taxon_namespace=tns`
                Attach ``tns`` as the bound (single, unified) taxonomic namespace
                reference for all objects.
            `attached_taxon_namespace=tns`
                Attach ``tns`` as the bound (single, unified) taxonomic namespace
                reference for all objects.
            `attach_taxon_namespace=True, attached_taxon_namespace=tns`
                Attach ``tns`` as the bound (single, unified) taxonomic namespace
                reference for all objects.
            `attach_taxon_namespace=True`
                Create a *new* |TaxonNamespace| and set it as the bound
                (single, unified) taxonomic namespace reference for all
                objects.
        """
        attach_taxon_namespace, taxon_namespace = taxonmodel.process_attached_taxon_namespace_directives(kwargs_dict)
        if attach_taxon_namespace or (taxon_namespace is not None):
            self.attach_taxon_namespace(taxon_namespace)
        return attach_taxon_namespace, taxon_namespace