New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance --search: only consider actual filename (not entire path), use regex syntax #1281
Conversation
for (dirpath, dirnames, filenames) in os.walk(path, topdown=True): | ||
for filename in filenames: | ||
filename = os.path.join(dirpath, filename) | ||
if filename.lower().find(query) != -1: | ||
if query.search(filename.lower()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add re.IGNORECASE
to the regex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, totally forgot about this option 👍
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Going in, thanks for the review @wpoely86! |
enhance --search: only consider actual filename (not entire path), use regex syntax
@martbhell: this resolves the problem you ran into during the EasyBuild hackathon @ CSC.fi |
enhance --search: only consider actual filename (not entire path), use regex syntax
This change is motivated by the output of
--search
that was produced byeb --search python
, which in practice resulted in all easyconfigs to be listed (since it's not unlikely that 'python' is part of the full path).With this change, this works as expected: