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

Add utility to validate ZIM folder and filename are OK #169

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

benoit74
Copy link
Collaborator

Fix #163

@benoit74 benoit74 self-assigned this Jun 18, 2024
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (baec9c1) to head (f4176f0).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #169   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         1393      1423   +30     
  Branches       240       243    +3     
=========================================
+ Hits          1393      1423   +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 marked this pull request as ready for review June 18, 2024 09:02
@benoit74 benoit74 requested a review from rgaudin June 18, 2024 09:02
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

It's OK except some naming for which I suggested alternatives.
Is this all necessary? I'm fine with it but I would have been satisfied with a single Exception and custom messages. This would fix the issue but with a smaller API extension.

src/zimscraperlib/zim/filesystem.py Show resolved Hide resolved
src/zimscraperlib/zim/filesystem.py Show resolved Hide resolved
src/zimscraperlib/zim/filesystem.py Show resolved Hide resolved
src/zimscraperlib/zim/filesystem.py Show resolved Hide resolved
@benoit74
Copy link
Collaborator Author

It's OK except some naming for which I suggested alternatives.

I've started to build a cheatsheet to stop forgetting about these namings for exc, fpath, ... : https://github.com/openzim/overview/wiki/Python-naming-conventions

Do not hesitate to contribute, you're probably way more aware than I am about all these

Is this all necessary? I'm fine with it but I would have been satisfied with a single Exception and custom messages. This would fix the issue but with a smaller API extension.

This was "necessary" because in warc2zim we have different exit codes depending on the problem encountered. I tend to consider that multiple exception is not a high price to pay in term of development or maintenance, and that it is important to keep open all potential use cases open in a shared library.

@benoit74 benoit74 merged commit 05984c3 into main Jun 20, 2024
10 checks passed
@benoit74 benoit74 deleted the check_zim_filename branch June 20, 2024 07:31
@benoit74
Copy link
Collaborator Author

I forgot to commit my changes, so none of your conversations are fixed in fact. Sorry, I've opened #171 with all fixes ...

@rgaudin
Copy link
Member

rgaudin commented Jun 20, 2024

I've started to build a cheatsheet to stop forgetting about these namings for exc, fpath, ... : https://github.com/openzim/overview/wiki/Python-naming-conventions

Do not hesitate to contribute, you're probably way more aware than I am about all these

I will, but I only see them when it's not aligned 😉

Is this all necessary? I'm fine with it but I would have been satisfied with a single Exception and custom messages. This would fix the issue but with a smaller API extension.

This was "necessary" because in warc2zim we have different exit codes depending on the problem encountered.

Great.

I tend to consider that multiple exception is not a high price to pay in term of development or maintenance, and that it is important to keep open all potential use cases open in a shared library.

It's the little things that piles up and end-up slowing down the whole project.
We've already decided long ago, from experience, that we only implement what's needed. There's always the possibility to extend and modify when need grows or change ; including for such libraries.
This is just a general feedback on your general last sentence of course 😉

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.

Add utility function to confirm ZIM can be created at given location / name
2 participants