mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
series_test()
This commit is contained in:
parent
4e05f2c076
commit
9b9c62b765
@ -67,6 +67,23 @@ def authors_test(authors):
|
||||
|
||||
return test
|
||||
|
||||
def series_test(series, series_index):
|
||||
series = series.lower()
|
||||
|
||||
def test(mi):
|
||||
ms = mi.series.lower() if mi.series else ''
|
||||
if (ms == series) and (series_index == mi.series_index):
|
||||
return True
|
||||
if mi.series:
|
||||
prints('Series test failed. Expected: \'%s [%d]\' found \'%s[%d]\''% \
|
||||
(series, series_index, ms, mi.series_index))
|
||||
else:
|
||||
prints('Series test failed. Expected: \'%s [%d]\' found no series'% \
|
||||
(series, series_index))
|
||||
return False
|
||||
|
||||
return test
|
||||
|
||||
def init_test(tdir_name):
|
||||
tdir = tempfile.gettempdir()
|
||||
lf = os.path.join(tdir, tdir_name.replace(' ', '')+'_identify_test.txt')
|
||||
|
@ -12,7 +12,7 @@ from zipfile import ZipFile, ZIP_DEFLATED, ZIP_STORED
|
||||
|
||||
from PyQt4.Qt import QDialog
|
||||
|
||||
from calibre.constants import isosx, iswindows
|
||||
from calibre.constants import isosx
|
||||
from calibre.gui2 import open_local_file
|
||||
from calibre.gui2.dialogs.tweak_epub_ui import Ui_Dialog
|
||||
from calibre.libunzip import extract as zipextract
|
||||
|
Loading…
x
Reference in New Issue
Block a user