From fb2d826a9d3e98184cb0d708f0e9ecddc1255c98 Mon Sep 17 00:00:00 2001 From: jsjiang Date: Tue, 3 Oct 2023 14:50:40 -0700 Subject: [PATCH] remove unused param; update comments --- impl/ezid.py | 2 +- impl/nog_sql/ezid_minter.py | 17 ++++++++--------- tests/util/util.py | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/impl/ezid.py b/impl/ezid.py index a8187163..eb47598f 100644 --- a/impl/ezid.py +++ b/impl/ezid.py @@ -207,7 +207,7 @@ def _mintIdentifier(shoulder, user, metadata={}): identifier=identifier ).exists(), ( f'Freshly minted identifier already exists in the database. ' - f'The minter BDB file for the shoulder may be outdated. ' + f'The minter state for the shoulder may be outdated. ' f'shoulder="{shoulder_model.prefix}", identifier="{identifier}"' ) diff --git a/impl/nog_sql/ezid_minter.py b/impl/nog_sql/ezid_minter.py index d4b41ea3..4e66252f 100755 --- a/impl/nog_sql/ezid_minter.py +++ b/impl/nog_sql/ezid_minter.py @@ -78,11 +78,11 @@ def mint_id(shoulder_model, dry_run=False): Args: shoulder_model (Django ORM model): Shoulder dry_run (bool): - False (default): After successful minting, the BerkeleyDB database on disk, + False (default): After successful minting, the Minter database, which stores the current state of the minter, is updated to the new state. This prevents the minter from returning the same ID the next time it is called. - True: The minter database on disk is not updated, so the same IDs are + True: The minter database is not updated, so the same IDs are returned again the next time the minter is called. This is useful for creating reproducible tests. @@ -112,10 +112,10 @@ def mint_ids(shoulder_model, mint_count=1, dry_run=False): N2T Nog operates. Args: + shoulder_model (Django ORM model): Shoulder mint_count (int, default=1): Set the number of IDs to mint. The caller must accept this number of IDs, in order for the generator to run to completion - and for the minter state to be updated. be run to completion in order for - the minter state to be updated. + and for the minter state to be updated. Yields (str): This is a generator that yields minted identifiers as described in :func:`mint_id`. @@ -130,7 +130,7 @@ def mint_ids(shoulder_model, mint_count=1, dry_run=False): # noinspection PyIncorrectDocstring,PyIncorrectDocstring def mint_by_prefix(prefix, mint_count=1, dry_run=False): - """Like mint_ids(), but accepts the path to a BerkeleyDB bdb minter + """Like mint_ids(), but accepts the prefix as input. file. Args: @@ -150,13 +150,12 @@ def mint_by_prefix(prefix, mint_count=1, dry_run=False): log.error(f'Minter Error: {ex}') -def create_minter_database(shoulder_ns, root_path=None, mask_str='eedk'): - """Create a new BerkeleyDB file +def create_minter_database(shoulder_ns, mask_str='eedk'): + """Create a new minter in the database Args: shoulder_ns: DOI or ARK shoulder namespace - root_path: - mask_str: + mask_str: mask string """ shoulder_ns = impl.nog_sql.id_ns.IdNamespace.from_str(shoulder_ns) diff --git a/tests/util/util.py b/tests/util/util.py index 8809232a..435edabe 100644 --- a/tests/util/util.py +++ b/tests/util/util.py @@ -57,7 +57,7 @@ def shoulder_to_dict(s): def create_shoulder_and_minter( - namespace_str, organization_name='test shoulder', root_path=None, mask_str='eedk' + namespace_str, organization_name='test shoulder', mask_str='eedk' ): is_doi = namespace_str[:4] == 'doi:' prefix_str, shoulder_str = namespace_str.split('/')[-2:] @@ -75,7 +75,7 @@ def create_shoulder_and_minter( active=True, manager='ezid', ) - impl.nog_sql.ezid_minter.create_minter_database(namespace_str, root_path, mask_str) + impl.nog_sql.ezid_minter.create_minter_database(namespace_str, mask_str) return shoulder_model