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: Allow only pathlib.Path as type for the path field in ListEntrymodel #16

Open
dl6nm opened this issue Jul 8, 2022 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@dl6nm
Copy link
Owner

dl6nm commented Jul 8, 2022

I'll suggest to use a pathlib.Path type only instead of also allowing a str to set in ListEntry model. This would be more straight forward for returning only one type, instead of guessing the right one.

In case of getting relative_paths out of the model, we can then use one of the following implementations in _PathTreeGenerator:

  • p.relative_to(self._root_dir), if relative_paths=True
  • p.relative_to('.'), if relative_paths=False

This can makt it easier to determine the absolute or relative path of a ListEntry in PathTree(...).tree().

@dl6nm dl6nm added enhancement New feature or request question Further information is requested labels Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant