1
0
mirror of https://github.com/ciromattia/kcc synced 2026-01-31 01:17:50 +00:00

Added RAR5 support

This commit is contained in:
Paweł Jastrzębski
2019-03-06 20:12:11 +01:00
parent 409f077c3e
commit 535c2c220b
2 changed files with 3 additions and 3 deletions

View File

@@ -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.')

View File

@@ -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)