-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: improve download_folder
functionality
#6
base: main
Are you sure you want to change the base?
feat: improve download_folder
functionality
#6
Conversation
GameTaco
commented
Sep 13, 2023
- Add docstrings for entry and download functions.
- Separate file and directory handling loops for easier changes.
- Implement extra items check with a user confirmation prompt.
- Created print statements, and error handling.
- Update isort, and min python for incompatible poetry and pre-commit
- Added [tool.poetry.group.dev.dependencies] format for poetry
- Add docstrings for entry and download functions. - Separate file and directory handling loops for easier changes. - Implement extra items check with a user confirmation prompt. - Created print statements, and error handling. - Update isort, and min python for incompatible poetry and pre-commit - Added [tool.poetry.group.dev.dependencies] format for poetry
if exists(fullpath): | ||
if force: | ||
if extra_items: |
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.
I think that if the force
is true
the removal of the folder should be automatic, if it's false
then ask to user if he/she wants to delete the folder and continue or cancel the operation. So:
if force:
...
elif extra_items:
...
else:
...
""" | ||
fullpath = join(output, path) | ||
existing_items = set(os.listdir(fullpath)) if os.path.exists(fullpath) else set() |
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.
from os import listdir, makedirs
...
existing_items = set(listdir(fullpath)) if exists(fullpath) else set()
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.
Also @GameTaco, please, upgrade the Python and Poetry versions of the GitHub Action tests to sync with the pyproject.toml
definition, thanks in advance.
download_folder
functionality