Skip to content

Commit

Permalink
remove unused param; update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjiang committed Oct 3, 2023
1 parent ea148f5 commit fb2d826
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion impl/ezid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"'
)

Expand Down
17 changes: 8 additions & 9 deletions impl/nog_sql/ezid_minter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`.
Expand All @@ -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:
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
Expand All @@ -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


Expand Down

0 comments on commit fb2d826

Please sign in to comment.