Commit 890dabf4 authored by mitshel's avatar mitshel
Browse files

Добавлен вывод ошибок, возникающих в модуле sopdsparse при включенном VERBOSE

Внесены исправления исправляющие ошибку при которой удалении zip-архива и последующем его восстановление его сканирование не производилось
parent ecf63f2f
Loading
Loading
Loading
Loading
−16 B (25.1 KiB)

File changed.

No diff preview for this file type.

+2 −1
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0):
                f=file
             fb2.parse(f,cfg.FB2HSIZE)
             f.close()

             if len(fb2.lang.getvalue())>0:
                lang=fb2.lang.getvalue()[0].strip(' \'\"')
             if len(fb2.book_title.getvalue())>0:
@@ -127,7 +128,7 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0):
             
             if VERBOSE:
                if fb2.parse_error!=0:
                   print('with fb2 parse warning...',end=" ")
                   print('with fb2 parse warning [',fb2.parse_errormsg,']', end=" ")

          if title=='':
             title=n
+1 −1
Original line number Diff line number Diff line
@@ -501,7 +501,7 @@ class opdsDatabase:
    return rows
  
  def zipisscanned(self,zipname,setavail=0):
    sql='select cat_id from '+TBL_CATALOGS+' where path="'+zipname+'" limit 1'
    sql='select cat_id from '+TBL_BOOKS+' where path="'+zipname+'" limit 1'
    cursor=self.cnx.cursor()
    cursor.execute(sql)
    row=cursor.fetchone()
+4 −2
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ class fb2parser:
       self.stoptag='description'
       self.process_description=True
       self.parse_error=0
       self.parse_errormsg=''

   def reset(self):
       self.process_description=True
@@ -204,5 +205,6 @@ class fb2parser:
            parser.Parse(f.read(hsize), True)
       except StopIteration:
         pass
       except:
         parse_error=1
       except Exception as err:
         self.parse_errormsg=err 
         self.parse_error=1