本文整理汇总了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