-
Notifications
You must be signed in to change notification settings - Fork 22
[Prototyping] Using rclone lsjson
for all searches
#530
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
Open
JoeZiminski
wants to merge
57
commits into
main
Choose a base branch
from
playing_search_function
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
lsjson
for all searcheslsjson
for all searches
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
superseded by #551
This PR is for prototyping the new way of searching files / folders introduced in #407. The main commit here is this one, all the others are from PR #208 which this was branched from for extended testing.
Generally this way is better because we can have one function for all use cases. I tried for a long time to play with
RClones
`--includeor
filter`` arguments, but I could not get reliable behaviour across folders and files.For example, if at a search path we have:
then
--include
with any search string (e.g.sub-*) would include all folders no matter what. The only want to avoid this was to suffix the search with a
/i..e
sub-*/`. So the search string would be different between files and folders. I may have missed something here, but I think it reflects that rlcone is more built for handling files directly, and the search functions etc. behave more naturally when transferring files but not folderes.The solution here is to just grab everything from
lsjson
and then parse it in Python. A benefit is it is more flexible and interpretable. A downside is it might be slower. However, as we are just performing 1-folder level of search (i.e. non-recursive) it should never be too bad as there are unlikely to be tens of thousands of files / folders in a single directory.Currently the
search_for_folders()
is set up for testing, but essentially it could be something as simple as:@cs7-shrey I think I can make a PR to switch SSH and local filesystem to this method (after a bit more work on it). Then you can use it directory from your AWS/Google drive PR?