Skip to content

Allow partial filename searches #2

@jontwo

Description

@jontwo

Partial searches during restore only apply to whole parts of the path, but should also include partial name matches. Something like:

def get_filename_index(s1, l2, exact=True):
    ...
    except ValueError:
        if not exact:
            global wildcard_matches
            for m in [f for f in l2 if fnmatch.fnmatch(f,'*{}*'.format(s1))]:
                if m not in wildcard_matches:
                    wildcard_matches.append(m)
        return None

and

    logger.warning('%s not found' % filename)
    if wildcard_matches:
        logger.info('some similar files were found though\n%s' % wildcard_matches)

This won't change the files restored, but will tell users what they could be searching for.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions