Skip to content

Conversation

yngvem
Copy link
Contributor

@yngvem yngvem commented Sep 2, 2024

Adds a save(filename: str, overwrite: bool = False)-function to turtle.py with the following input validation:

  • FileNotFoundError that explicitly state that the directory is missing if someone tries to save to an non-existing directory
  • ValueError if the file exists and overwrite=False
  • ValueError if the file does not end with ps or eps

Co-authored-by: Marie Roald 3594989+MarieRoald@users.noreply.github.com

Co-authored-by: Marie Roald <roald.marie@gmail.com>
@ghost
Copy link

ghost commented Sep 2, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Sep 2, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

blurb-it bot and others added 2 commits September 2, 2024 20:39
Co-authored-by: Marie Roald <roald.marie@gmail.com>
@nineteendo
Copy link
Contributor

Could you add documentation? And I would raise FileExistsError if the file already exists and overwrite is false.

MarieRoald and others added 3 commits September 4, 2024 17:36
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
Co-authored-by: Yngve Mardal Moe <yngve.m.moe@gmail.com>
@MarieRoald
Copy link
Contributor

We have updated the documentation now and changed the code to use the FileExistsError and make sure that the all pipeline checks pass

yngvem and others added 2 commits September 8, 2024 15:45
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Copy link
Contributor

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

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.

5 participants