-
Notifications
You must be signed in to change notification settings - Fork 230
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
Changes from 4 commits
4bb4231
61750a9
bbad054
a2f4512
0a938fa
93ce0e5
a07e089
0595341
bcfcb1c
3d297c1
b8af6ae
9a0f926
06a44c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ KindleComicConverter*.egg-info/ | |
/kindlegen* | ||
/kcc.bat | ||
.DS_Store | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
||
# noinspection PyUnboundLocalVariable | ||
def run(self): | ||
MW.modeConvert.emit(0) | ||
|
@@ -452,12 +452,23 @@ def selectDir(self): | |
if self.needClean: | ||
self.needClean = False | ||
GUI.jobList.clear() | ||
|
||
dname = QtWidgets.QFileDialog.getExistingDirectory(MW, 'Select directory', self.lastPath) | ||
if dname != '': | ||
if sys.platform.startswith('win'): | ||
dname = dname.replace('/', '\\') | ||
self.lastPath = os.path.abspath(os.path.join(dname, os.pardir)) | ||
|
||
GUI.jobList.addItem(dname) | ||
|
||
for root, _, files in os.walk(dname): | ||
for file in files: | ||
if file.lower().endswith('.cbz'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
file_path = os.path.join(root, file) | ||
if sys.platform.startswith('win'): | ||
file_path = file_path.replace('/', '\\') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
GUI.jobList.addItem(file_path) | ||
|
||
GUI.jobList.scrollToBottom() | ||
|
||
def selectFile(self): | ||
|
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.
don't add random spaces.
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.
done.