Merge from trunk

This commit is contained in:
Charles Haley 2011-03-04 17:51:01 +00:00
commit a891b5d49a
3 changed files with 14 additions and 1 deletions

View File

@ -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):

View File

@ -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:

View File

@ -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: