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