mirror of
https://github.com/ciromattia/kcc
synced 2026-08-31 16:07:06 +00:00
Added RAR5 support
This commit is contained in:
@@ -1078,7 +1078,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
class KCCGUI_MetaEditor(KCC_ui_editor.Ui_editorDialog):
|
class KCCGUI_MetaEditor(KCC_ui_editor.Ui_editorDialog):
|
||||||
def loadData(self, file):
|
def loadData(self, file):
|
||||||
self.parser = metadata.MetadataParser(file)
|
self.parser = metadata.MetadataParser(file)
|
||||||
if self.parser.format == 'RAR':
|
if self.parser.format in ['RAR', 'RAR5']:
|
||||||
self.editorWidget.setEnabled(False)
|
self.editorWidget.setEnabled(False)
|
||||||
self.okButton.setEnabled(False)
|
self.okButton.setEnabled(False)
|
||||||
self.statusLabel.setText('CBR metadata are read-only.')
|
self.statusLabel.setText('CBR metadata are read-only.')
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class ComicArchive:
|
|||||||
process.communicate()
|
process.communicate()
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
raise OSError('Archive is corrupted or encrypted.')
|
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.')
|
raise OSError('Unsupported archive format.')
|
||||||
|
|
||||||
def extract(self, targetdir):
|
def extract(self, targetdir):
|
||||||
@@ -61,7 +61,7 @@ class ComicArchive:
|
|||||||
return targetdir
|
return targetdir
|
||||||
|
|
||||||
def addFile(self, sourcefile):
|
def addFile(self, sourcefile):
|
||||||
if self.type == 'RAR':
|
if self.type in ['RAR', 'RAR5']:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
process = Popen('7z a -y "' + self.filepath + '" "' + sourcefile + '"',
|
process = Popen('7z a -y "' + self.filepath + '" "' + sourcefile + '"',
|
||||||
stdout=PIPE, stderr=STDOUT, shell=True)
|
stdout=PIPE, stderr=STDOUT, shell=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user