Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pymake/utils/_usgs_src_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import types
from typing import Union

from ..utils.usgsprograms import usgs_program_data


def _get_function_names(module, select_name=None):
"""Get a dictionary of functions available in a user-specified source file.
Expand Down Expand Up @@ -63,9 +65,13 @@ def _build_replace(targets):
if isinstance(targets, str):
targets = [targets]

# remove exe extension from targets
# remove exe extension from targets, as well as
# d (debug) and dbl (double precision) suffixes
for idx, target in enumerate(targets):
targets[idx] = pl.Path(target).with_suffix("").name
tgt = pl.Path(target).with_suffix("").name.replace("dbl", "")
if tgt.endswith("d") and tgt[:-1] in usgs_program_data.get_keys():
tgt = tgt[:-1]
targets[idx] = tgt

# get a dictionary of update functions
funcs = _get_function_names(sys.modules[__name__], select_name="_update_")
Expand Down