本文整理匯總了Python中calibre.utils.ipc.RC.is_alive方法的典型用法代碼示例。如果您正苦於以下問題:Python RC.is_alive方法的具體用法?Python RC.is_alive怎麽用?Python RC.is_alive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類calibre.utils.ipc.RC
的用法示例。
在下文中一共展示了RC.is_alive方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ensure_single_instance
# 需要導入模塊: from calibre.utils.ipc import RC [as 別名]
# 或者: from calibre.utils.ipc.RC import is_alive [as 別名]
def ensure_single_instance(args, open_at):
try:
from calibre.utils.lock import singleinstance
si = singleinstance(singleinstance_name)
except Exception:
import traceback
error_dialog(None, _('Cannot start viewer'), _(
'Failed to start viewer, could not insure only a single instance of the viewer is running. Click "Show Details" for more information'),
det_msg=traceback.format_exc(), show=True)
raise SystemExit(1)
if not si:
if len(args) > 1:
t = RC(print_error=True, socket_address=viewer_socket_address())
t.start()
t.join(3.0)
if t.is_alive() or t.conn is None:
error_dialog(None, _('Connect to viewer failed'), _(
'Unable to connect to existing viewer window, try restarting the viewer.'), show=True)
raise SystemExit(1)
t.conn.send((os.path.abspath(args[1]), open_at))
t.conn.close()
prints('Opened book in existing viewer instance')
raise SystemExit(0)
listener = create_listener()
return listener
示例2: build_pipe
# 需要導入模塊: from calibre.utils.ipc import RC [as 別名]
# 或者: from calibre.utils.ipc.RC import is_alive [as 別名]
def build_pipe(print_error=True):
t = RC(print_error=print_error)
t.start()
t.join(3.0)
if t.is_alive():
cant_start()
raise SystemExit(1)
return t
示例3: build_pipe
# 需要導入模塊: from calibre.utils.ipc import RC [as 別名]
# 或者: from calibre.utils.ipc.RC import is_alive [as 別名]
def build_pipe(print_error=True):
t = RC(print_error=print_error)
t.start()
t.join(3.0)
if t.is_alive():
if iswindows:
cant_start()
else:
f = os.path.expanduser('~/.calibre_calibre GUI.lock')
cant_start(what=_('try deleting the file')+': '+f)
raise SystemExit(1)
return t