Loading opds_catalog/__pycache__/sopdscan.cpython-35.pyc +142 B (7 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/sopdscan.py +63 −57 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class opdsScanner: self.arch_scanned = 0 self.arch_skipped = 0 self.bad_archives = 0 self.bad_books = 0 self.books_in_archives = 0 def init_parser(self): Loading @@ -49,6 +50,7 @@ class opdsScanner: self.t2=datetime.timedelta(seconds=time.time()) self.logger.info('Books added : '+str(self.books_added)) self.logger.info('Books skipped : '+str(self.books_skipped)) self.logger.info('Bad books : '+str(self.bad_books)) if settings.DELETE_LOGICAL: self.logger.info('Books deleted : '+str(self.books_deleted)) else: Loading Loading @@ -147,6 +149,7 @@ class opdsScanner: lang='' annotation='' docdate='' book_is_valid = True if e.lower()=='.fb2' and settings.FB2PARSE: if isinstance(file, str): Loading @@ -168,7 +171,10 @@ class opdsScanner: if self.fb2parser.parse_error!=0: errormsg='' self.logger.warning(rel_path+' - '+name+' fb2 parse error ['+errormsg+']') book_is_valid = False self.bad_books+=1 if book_is_valid: if title=='': title=n book=opdsdb.addbook(name,rel_path,cat,e,title,annotation,docdate,lang,file_size,archive) Loading opds_catalog/tests/__pycache__/test_scan.cpython-35.pyc +32 B (4.7 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/tests/data/badfile.fb2 0 → 100644 +1 −0 Original line number Diff line number Diff line This not fb2 file for tests opds_catalog/tests/test_scan.py +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class scanTestCase(TestCase): scanner = opdsScanner() scanner.scan_all() self.assertEquals(scanner.books_added, 4) self.assertEquals(scanner.bad_books, 1) self.assertEquals(Book.objects.all().count(), 4) self.assertEquals(Author.objects.all().count(), 4) self.assertEquals(Genre.objects.all().count(), 4) Loading Loading
opds_catalog/__pycache__/sopdscan.cpython-35.pyc +142 B (7 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/sopdscan.py +63 −57 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class opdsScanner: self.arch_scanned = 0 self.arch_skipped = 0 self.bad_archives = 0 self.bad_books = 0 self.books_in_archives = 0 def init_parser(self): Loading @@ -49,6 +50,7 @@ class opdsScanner: self.t2=datetime.timedelta(seconds=time.time()) self.logger.info('Books added : '+str(self.books_added)) self.logger.info('Books skipped : '+str(self.books_skipped)) self.logger.info('Bad books : '+str(self.bad_books)) if settings.DELETE_LOGICAL: self.logger.info('Books deleted : '+str(self.books_deleted)) else: Loading Loading @@ -147,6 +149,7 @@ class opdsScanner: lang='' annotation='' docdate='' book_is_valid = True if e.lower()=='.fb2' and settings.FB2PARSE: if isinstance(file, str): Loading @@ -168,7 +171,10 @@ class opdsScanner: if self.fb2parser.parse_error!=0: errormsg='' self.logger.warning(rel_path+' - '+name+' fb2 parse error ['+errormsg+']') book_is_valid = False self.bad_books+=1 if book_is_valid: if title=='': title=n book=opdsdb.addbook(name,rel_path,cat,e,title,annotation,docdate,lang,file_size,archive) Loading
opds_catalog/tests/__pycache__/test_scan.cpython-35.pyc +32 B (4.7 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/tests/data/badfile.fb2 0 → 100644 +1 −0 Original line number Diff line number Diff line This not fb2 file for tests
opds_catalog/tests/test_scan.py +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class scanTestCase(TestCase): scanner = opdsScanner() scanner.scan_all() self.assertEquals(scanner.books_added, 4) self.assertEquals(scanner.bad_books, 1) self.assertEquals(Book.objects.all().count(), 4) self.assertEquals(Author.objects.all().count(), 4) self.assertEquals(Genre.objects.all().count(), 4) Loading