The itemlimit now accepts a 2-tuple as an argument, indicating a separate limit for folders and files (respectively).
Added two parameters for handling errors when trying to list the children of a directory:
acceptable_listdir_errors: One or more error types (Exceptions) which are ignored when occurring during a directory listing call. E.g., a permissions error.
denied_string: String to add to follow directory entries for which the error was triggered.
More test cases added
Changed
The main algorithm for folder tree traversal has been refactored.
The unit tests are now structured for pytest.
seedir.folderstructure.FolderStructure is now an abstract class that cannot be directly instantiated. The functions that previously needed to be provided as arguments for the constructor must now be implemented as part of a subclass (see getting started for an example)
Deprecated
slash is now totally deprecated; use folderend instead.
The itemlimit now accepts a 2-tuple as an argument, indicating a separate limit for folders and files (respectively).
Added two parameters for handling errors when trying to list the children of a directory:
acceptable_listdir_errors: One or more error types (Exceptions) which are ignored when occurring during a directory listing call. E.g., a permissions error.
denied_string: String to add to follow directory entries for which the error was triggered.
More test cases added
Changed
The main algorithm for folder tree traversal has been refactored.
The unit tests are now structured for pytest.
seedir.folderstructure.FolderStructure is now an abstract class that cannot be directly instantiated. The functions that previously needed to be provided as arguments for the constructor must now be implemented as part of a subclass (see getting started for an example)
Deprecated
slash is now totally deprecated; use folderend instead.
pathlib Path objects now accepted by sd.seedir(). All other arguments apply as normal; arguments accepting callables (mask and formatter) will see pathlib objects.
Changed
emoji is now an optional dependency. It can be installed with pip install seedir[emoji]. An error is raised if the emoji style is requested without emoji installed.
Reorganization of folderstructure.py and the FolderStructure class
folderstructurehelpers.py has been removed. Most of the functions implemented there have become methods of FolderStucture.
FolderStructure has been made more user-friendly, and can now be initialized with less functions.
There are no longer separate "real dir"/"fake dir" functions for handing item filtering/sorting.
Item inclusion is now prioritized above exclusion for include/exclude folders/files. The order of precedence now is mask (1), inclusion (2), exclusion (3). The code in this function was generally rewritten to be more concise (FolderStructure._filter_items()).
The ~ in paths is now resolved, as well as . and ..
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Updates the requirements on seedir to permit the latest version.
Release notes
Sourced from seedir's releases.
Changelog
Sourced from seedir's changelog.
... (truncated)
Commits
300a22d
Update CHANGELOG.mde833147
update docs8561cc5
increment version1a39433
move print examples tests to separate file83a6b07
add test cases for error handling61de607
add error handling parameters2fe5a1e
change FolderStructure to abstract class74bd000
remove unneeded warnings6124012
remove slashe383d85
add tests for tuple itemlimitDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show