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

feat: improve download_folder functionality #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GameTaco
Copy link

  • 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:
Copy link
Owner

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()
Copy link
Owner

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()

Copy link
Owner

@leynier leynier left a 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.

@leynier leynier changed the title feat: Improve download_folder Functionality feat: improve download_folder functionality Sep 13, 2023
@leynier leynier changed the title feat: improve download_folder functionality feat: improve download_folder functionality Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants