-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update WorkspaceClient
to support globbing
#125
Update WorkspaceClient
to support globbing
#125
Conversation
❌ 17/18 passed, 1 failed, 2 skipped, 32s total ❌ test_mkdirs: TypeError: can only concatenate list (not "method") to list (4ms)
Running from acceptance #175 |
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.
lgtm
|
||
def glob(self, pattern, *, case_sensitive=None): | ||
pattern_parts = self._prepare_pattern(pattern) | ||
selector = _Selector.parse(pattern_parts, case_sensitive=case_sensitive if case_sensitive is not None else True) |
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.
selector = _Selector.parse(pattern_parts, case_sensitive=case_sensitive if case_sensitive is not None else True) | |
case_sensitive = case_sensitive if case_sensitive is not None else True | |
selector = _Selector.parse(pattern_parts, case_sensitive=case_sensitive) |
|
||
def rglob(self, pattern, *, case_sensitive=None): | ||
pattern_parts = ("**", *self._prepare_pattern(pattern)) | ||
selector = _Selector.parse(pattern_parts, case_sensitive=case_sensitive if case_sensitive is not None else True) |
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.
selector = _Selector.parse(pattern_parts, case_sensitive=case_sensitive if case_sensitive is not None else True) | |
case_sensitive = case_sensitive if case_sensitive is not None else True | |
selector = _Selector.parse(pattern_parts, case_sensitive=case_sensitive) |
This PR is stacked on top of #122 and updates
WorkspaceClient
to support:.glob()
.rglob()
.iterdir()