Exemple #1
0
 def _load_ebook_worker(self, pathtoebook, open_at, reload_book):
     try:
         ans = prepare_book(pathtoebook,
                            force=reload_book,
                            prepare_notify=self.prepare_notify)
     except WorkerError as e:
         self.book_prepared.emit(False, {
             'exception': e,
             'tb': e.orig_tb,
             'pathtoebook': pathtoebook
         })
     except Exception as e:
         import traceback
         self.book_prepared.emit(
             False, {
                 'exception': e,
                 'tb': traceback.format_exc(),
                 'pathtoebook': pathtoebook
             })
     else:
         performance_monitor('prepared emitted')
         self.book_prepared.emit(
             True, {
                 'base': ans,
                 'pathtoebook': pathtoebook,
                 'open_at': open_at,
                 'reloaded': reload_book
             })
Exemple #2
0
 def _load_ebook_worker(self, pathtoebook, open_at, reload_book):
     if DEBUG:
         start_time = monotonic()
     try:
         ans = prepare_book(pathtoebook,
                            force=reload_book,
                            prepare_notify=self.prepare_notify)
     except WorkerError as e:
         self.book_prepared.emit(False, {
             'exception': e,
             'tb': e.orig_tb,
             'pathtoebook': pathtoebook
         })
     except Exception as e:
         import traceback
         self.book_prepared.emit(
             False, {
                 'exception': e,
                 'tb': traceback.format_exc(),
                 'pathtoebook': pathtoebook
             })
     else:
         if DEBUG:
             print('Book prepared in {:.2f} seconds'.format(monotonic() -
                                                            start_time))
         self.book_prepared.emit(
             True, {
                 'base': ans,
                 'pathtoebook': pathtoebook,
                 'open_at': open_at,
                 'reloaded': reload_book
             })
Exemple #3
0
 def _load_ebook_worker(self, pathtoebook, open_at, reload_book):
     try:
         ans = prepare_book(pathtoebook, force=reload_book)
     except WorkerError as e:
         self.book_prepared.emit(False, {'exception': e, 'tb': e.orig_tb, 'pathtoebook': pathtoebook})
     except Exception as e:
         import traceback
         self.book_prepared.emit(False, {'exception': e, 'tb': traceback.format_exc(), 'pathtoebook': pathtoebook})
     else:
         self.book_prepared.emit(True, {'base': ans, 'pathtoebook': pathtoebook, 'open_at': open_at})