Skip to content
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

Refactor findFiles function #178

Open
bitsgalore opened this issue Jan 19, 2022 · 1 comment
Open

Refactor findFiles function #178

bitsgalore opened this issue Jan 19, 2022 · 1 comment

Comments

@bitsgalore
Copy link
Member

bitsgalore commented Jan 19, 2022

The code in the findFiles function is very complex and difficult to read. It might be possible to simplify things using e.g. the Pathlib module, which also supports glob patterns. See also here.

Pathlib is only available for Python 3.4 and more recent, so this refactor should wait until we decide to drop Python 2.7 support.

Also, any changes in this part of the code will need thorough cross-platform testing, as I remember getting this to work in the first place was quite a challenge, see discussion here and here.

@bitsgalore
Copy link
Member Author

First step could be to simplify handling of glob patterns, following:

KBNLresearch/isolyzer@fa48ba6

(In this case the OS takes care of the glob expansion on Linux-based platforms)

Stand-alone test script here:

https://gist.github.com/bitsgalore/668eed7ae4421468f83c8ab7e38556f1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant