qgreenland/util/misc.py
def find_single_file_by_ext(path, *, ext):
    """Return a single file with matching extension.

    Fails for any number of results except 1.
    """
    files = find_in_dir_by_pattern(path, pattern=f'*{ext}')
    if len(files) > 1:
        raise NotImplementedError(
            f"We're not ready to handle multiple '{ext}' files in one task yet!"
        )

    try:
        return files[0]
    except IndexError:
        raise RuntimeError(f"No files with extension '{ext}' found at '{path}'")
Return a single file with matching extension.

    Fails for any number of results except 1.
    
Return a single file with matching extension.
Fails for any number of results except 1.
Return a single file with matching extension . Fails for any number of results except 1 .
def find_single_file_by_ext(path, *, ext):
    files = find_in_dir_by_pattern(path, pattern=f'*{ext}')
    if len(files) > 1:
        raise NotImplementedError(
            f"We're not ready to handle multiple '{ext}' files in one task yet!"
        )
    try:
        return files[0]
    except IndexError:
        raise RuntimeError(f"No files with extension '{ext}' found at '{path}'")
def find_single_file_by_ext ( path , * , ext ) : files = find_in_dir_by_pattern ( path , pattern = f'*{ext}' ) if len ( files ) > 1 : raise NotImplementedError ( f"We're not ready to handle multiple '{ext}' files in one task yet!" ) try : return files [ 0 ] except IndexError : raise RuntimeError ( f"No files with extension '{ext}' found at '{path}'" )
Return a single file with matching extension.
Return a single file with matching extension .
"""Return a single file with matching extension.

    Fails for any number of results except 1.
    """
path
ext