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

added cbz unpacking functionality when adding cbz files using directoryButton #700

Closed
wants to merge 13 commits into from

Conversation

8uziak
Copy link

@8uziak 8uziak commented May 25, 2024

  • New functionality works the same as adding .cbz files one by one using "Add file" button,
  • added 3 necessary functions which make this process possible in comic2ebook.py (listFiles, listCbzFiles) and 1 in KCC_gui.py (displayProgressMessage)
  • (unrelated) code of conduct added

Related:

8uziak and others added 2 commits May 25, 2024 22:04
added cbz unpacking functionality when adding cbz files using directoryButton
@8uziak
Copy link
Author

8uziak commented May 25, 2024

#695

@axu2
Copy link
Collaborator

axu2 commented May 26, 2024

Why do they all end with S?

def listFilesS(source):

Also, use this syntax in first post to link PR to issue

- fix #695

Also, code doesn't run if 7z isn't installed and only using tar.

@8uziak
Copy link
Author

8uziak commented May 26, 2024

Why do they all end with S?

My bad, I will fix it.

Also, use this syntax in first post to link PR to issue

Done

Also, code doesn't run if 7z isn't installed and only using tar.

Isn't 7zip required to work properly?

README
README

kindlecomicconverter/KCC_gui.py Outdated Show resolved Hide resolved
kindlecomicconverter/comic2ebook.py Outdated Show resolved Hide resolved
8uziak and others added 2 commits May 26, 2024 22:52
… detects .cbz files and shows them as an input before clicking convert button
reversed previous changes and added directory unpacking feature
@8uziak
Copy link
Author

8uziak commented May 26, 2024

This time I took different approach with adding .cbz files via add directory button and decided .cbz files to appear exactly the same as adding files by drag and drop feature or selecting files after clicking add file button.

@axu2 is something wrong with new changes?

Copy link
Collaborator

@axu2 axu2 left a comment

Choose a reason for hiding this comment

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

Overall, this approach is much simpler.

But I'm not sure about this feature since it's only matching existing behavior.

The "Merge all files" feature could be interesting if you have a good way to name the output. I edited my post here with more details: #612 (comment)

That other feature might also affect how you approach this feature.

if file.lower().endswith('.cbz'):
file_path = os.path.join(root, file)
if sys.platform.startswith('win'):
file_path = file_path.replace('/', '\\')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd do the research, but pretty sure this kind of code is a relic of older Python/Windows and can be removed in modern computers repo-wide. (maybe in a separate PR).

os.path.join handles any conversions.

Copy link
Author

Choose a reason for hiding this comment

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

done.


for root, _, files in os.walk(dname):
for file in files:
if file.lower().endswith('.cbz'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only supporting CBZ and not other archives like zip/cbr isn't the best.

Copy link
Author

Choose a reason for hiding this comment

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

done.

@@ -206,7 +206,7 @@ def clean(self):
MW.addMessage.emit('<b>Conversion interrupted.</b>', 'error', False)
MW.addTrayMessage.emit('Conversion interrupted.', 'Critical')
MW.modeConvert.emit(1)

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't add random spaces.

Copy link
Author

Choose a reason for hiding this comment

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

done.

@8uziak
Copy link
Author

8uziak commented Jun 1, 2024

Added code of conduct to repo by the way. It's (probably) good practice to have it.

@axu2
Copy link
Collaborator

axu2 commented Aug 28, 2024

Closing based on discussion in #612, reopen as needed. That feature probably affects how you want to approach this.

@axu2 axu2 closed this Aug 28, 2024
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.

[bug] failed to detect CBZ files using Add directory button
2 participants