mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Merge from trunk
This commit is contained in:
commit
a891b5d49a
@ -65,7 +65,8 @@ class Source(Plugin):
|
||||
parts = parts[1:] + parts[:1]
|
||||
for tok in parts:
|
||||
tok = pat.sub('', tok).strip()
|
||||
yield tok
|
||||
if len(tok) > 2 and tok.lower() not in ('von', ):
|
||||
yield tok
|
||||
|
||||
|
||||
def get_title_tokens(self, title):
|
||||
|
@ -94,7 +94,14 @@ class Worker(object):
|
||||
if not hasattr(self, 'child'): return None
|
||||
return getattr(self.child, 'pid', None)
|
||||
|
||||
def close_log_file(self):
|
||||
try:
|
||||
self._file.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
def kill(self):
|
||||
self.close_log_file()
|
||||
try:
|
||||
if self.is_alive:
|
||||
if iswindows:
|
||||
|
@ -34,6 +34,7 @@ class ConnectedWorker(Thread):
|
||||
self.killed = False
|
||||
self.log_path = worker.log_path
|
||||
self.rfile = rfile
|
||||
self.close_log_file = getattr(worker, 'close_log_file', None)
|
||||
|
||||
def start_job(self, job):
|
||||
notification = PARALLEL_FUNCS[job.name][-1] is not None
|
||||
@ -185,6 +186,10 @@ class Server(Thread):
|
||||
|
||||
# Remove finished jobs
|
||||
for worker in [w for w in self.workers if not w.is_alive]:
|
||||
try:
|
||||
worker.close_log_file()
|
||||
except:
|
||||
pass
|
||||
self.workers.remove(worker)
|
||||
job = worker.job
|
||||
if worker.returncode != 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user