Merge pull request #206 from lordwelch/rarOptionalFix
Fix rarfile import as by default it is optional
This commit is contained in:
commit
55cacf8f37
@ -26,7 +26,11 @@ import io
|
|||||||
|
|
||||||
import natsort
|
import natsort
|
||||||
from PyPDF2 import PdfFileReader
|
from PyPDF2 import PdfFileReader
|
||||||
|
try:
|
||||||
from unrar.cffi import rarfile
|
from unrar.cffi import rarfile
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import Image
|
import Image
|
||||||
pil_available = True
|
pil_available = True
|
||||||
@ -627,7 +631,10 @@ class ComicArchive:
|
|||||||
return zipfile.is_zipfile(self.path)
|
return zipfile.is_zipfile(self.path)
|
||||||
|
|
||||||
def rarTest(self):
|
def rarTest(self):
|
||||||
|
try:
|
||||||
return rarfile.is_rarfile(self.path)
|
return rarfile.is_rarfile(self.path)
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|
||||||
def isZip(self):
|
def isZip(self):
|
||||||
return self.archive_type == self.ArchiveType.Zip
|
return self.archive_type == self.ArchiveType.Zip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user