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
+2 -2
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)