MCPcopy
hub / github.com/pimutils/vdirsyncer / join

Method join

vdirsyncer/cli/utils.py:358–384  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

356
357 @contextlib.contextmanager
358 def join(self):
359 assert self._workers or not self._queue.unfinished_tasks
360 ui_worker = click_threading.UiWorker()
361 self._shutdown_handlers.append(ui_worker.shutdown)
362 _echo = click.echo
363
364 with ui_worker.patch_click():
365 yield
366
367 if not self._workers:
368 # Ugly hack, needed because ui_worker is not running.
369 click.echo = _echo
370 cli_logger.critical('Nothing to do.')
371 sys.exit(5)
372
373 ui_worker.run()
374 self._queue.join()
375 for worker in self._workers:
376 worker.join()
377
378 tasks_failed = next(self.num_failed_tasks)
379 tasks_done = next(self.num_done_tasks)
380
381 if tasks_failed > 0:
382 cli_logger.error('{} out of {} tasks failed.'
383 .format(tasks_failed, tasks_done))
384 sys.exit(1)
385
386 def put(self, f):
387 return self._queue.put(f)

Callers 15

syncFunction · 0.95
metasyncFunction · 0.95
discoverFunction · 0.95
with_uidMethod · 0.80
normalize_itemFunction · 0.80
_strip_timezonesFunction · 0.80
split_collectionFunction · 0.80
join_collectionFunction · 0.80
discoverMethod · 0.80
create_collectionMethod · 0.80
_get_filepathMethod · 0.80
listMethod · 0.80

Calls 1

runMethod · 0.45

Tested by 15

test_is_not_directoryMethod · 0.64
test_listFunction · 0.64
innerMethod · 0.64
etesync_appFunction · 0.64
get_storage_argsMethod · 0.64
innerMethod · 0.64
test_split_contactsFunction · 0.64
test_hash_itemFunction · 0.64
test_input_typesFunction · 0.64
get_unparsed_linesMethod · 0.64