From 535c2c220bfa303fd2b760843d3e5ba86358e356 Mon Sep 17 00:00:00 2001 From: Paweł Jastrzębski Date: Wed, 6 Mar 2019 20:12:11 +0100 Subject: Added RAR5 support --- kindlecomicconverter/KCC_gui.py | 2 +- kindlecomicconverter/comicarchive.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'kindlecomicconverter') diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 7dcfbe6..33ef984 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -1078,7 +1078,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): class KCCGUI_MetaEditor(KCC_ui_editor.Ui_editorDialog): def loadData(self, file): self.parser = metadata.MetadataParser(file) - if self.parser.format == 'RAR': + if self.parser.format in ['RAR', 'RAR5']: self.editorWidget.setEnabled(False) self.okButton.setEnabled(False) self.statusLabel.setText('CBR metadata are read-only.') diff --git a/kindlecomicconverter/comicarchive.py b/kindlecomicconverter/comicarchive.py index 214ae8d..435a99c 100644 --- a/kindlecomicconverter/comicarchive.py +++ b/kindlecomicconverter/comicarchive.py @@ -40,7 +40,7 @@ class ComicArchive: process.communicate() if process.returncode != 0: raise OSError('Archive is corrupted or encrypted.') - elif self.type not in ['7Z', 'RAR', 'ZIP']: + elif self.type not in ['7Z', 'RAR', 'RAR5', 'ZIP']: raise OSError('Unsupported archive format.') def extract(self, targetdir): @@ -61,7 +61,7 @@ class ComicArchive: return targetdir def addFile(self, sourcefile): - if self.type == 'RAR': + if self.type in ['RAR', 'RAR5']: raise NotImplementedError process = Popen('7z a -y "' + self.filepath + '" "' + sourcefile + '"', stdout=PIPE, stderr=STDOUT, shell=True) -- cgit 1.4.1