-
Notifications
You must be signed in to change notification settings - Fork 2
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
Skip branches #3
Comments
That looks like a neat way of defining folder structures that should be ignored by cQuery. I think that it might be a good idea to make sure that the |
Good point. How about something like this: /projects/spiderman/assets/Peter
/projects/spiderman/assets/Mary
Selector .Asset
2 results in 0.003s
Skipped
/projects/spiderman/secret_stuff
/projects/spiderman/more_stuff
/projects/spiderman/internal_data Also, would |
Yeah, that looks great! I assume that this is what you would get when using the command line. How would you go about implementing it when using cQuery from a Python script and not interfere with any values returned? In regards of the name, I would personally go for |
Tough question, let's brainstorm: 1. Alter return valueThis is how languages like Go does it, always return more than required, and leave it up to the user to ignore what they don't need. Works, but leaves quite a mess. >>> match, stats = cquery.first_match("/home/marcus", ".Asset")
>>> stats
{'ignored: ["/home/marcus/private", "/home/marcus/another_private"]} To ignore stats: >>> match, _ = cquery.first_match("/home/marcus", ".Asset")
>>> match
/home/marcus/assets/Peter 2. External queryIt would most likely be a debugging feature, so it may make sense to put into an additional method, although it would incur additional cost in terms of processing and traversing as we would have to run a scan twice if we needed to get both queries and ignored directories. >>> ignored = cquery.ignored("/home/marcus")
>>> ignored
["/home/marcus/private", "/home/marcus/another_private"] At this point, the return value could get cached and stored within the index for faster retrieval. |
Special-purpose metadata to indicate that a folder and its content should be skipped.
Upon querying the descending hierarchy or
marcus
, do not proceed into nor further than private_stuff. Surrounding branches are still queried. The idea is to limit the breadth of cQuery for branches of the file-system that should not be traversed; such as administrative folders or temporary storages.The text was updated successfully, but these errors were encountered: