本文整理汇总了Python中OmniMarkupLib.RendererManager.RendererManager.has_renderer_enabled_in_view方法的典型用法代码示例。如果您正苦于以下问题:Python RendererManager.has_renderer_enabled_in_view方法的具体用法?Python RendererManager.has_renderer_enabled_in_view怎么用?Python RendererManager.has_renderer_enabled_in_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OmniMarkupLib.RendererManager.RendererManager
的用法示例。
在下文中一共展示了RendererManager.has_renderer_enabled_in_view方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: queue
# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import has_renderer_enabled_in_view [as 别名]
def queue(self, view, preemptive=True, timeout=0.5):
if not RendererManager.has_renderer_enabled_in_view(view):
return
view_id = view.id()
now = time.time()
with self.mutex:
if view_id in self.delayed_views:
if now - self.last_signaled <= 0.01: # Too fast, cancel this operation
return
if preemptive:
# Cancel pending actions
with self.cond:
if view_id in self.delayed_views:
del self.delayed_views[view_id]
self.cond.notify()
RendererManager.queue_view(view, only_exists=True)
self.last_signaled = now
else:
with self.cond:
filename = view.file_name()
if view_id not in self.delayed_views:
self.delayed_views[view_id] = self.Entry(view, filename, timeout)
else:
entry = self.delayed_views[view_id]
entry.view = view
entry.filename = filename
entry.timeout = timeout
self.cond.notify()
示例2: queue_to_renderer_manager
# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import has_renderer_enabled_in_view [as 别名]
def queue_to_renderer_manager(self, view, filename):
view_id = view.id()
valid_view = False
for window in sublime.windows():
if valid_view:
break
for v in window.views():
if v.id() == view_id: # Got view
valid_view = True
break
if not valid_view or view.is_loading() or view.file_name() != filename:
return
if RendererManager.has_renderer_enabled_in_view(view):
RendererManager.queue_view(view, only_exists=True)
self.last_signaled = time.time()
示例3: on_query_context
# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import has_renderer_enabled_in_view [as 别名]
def on_query_context(self, view, key, operator, operand, match_all):
# omp_is_enabled is here for backwards compatibility
if key == 'omnimarkup_is_enabled' or key == 'omp_is_enabled':
return RendererManager.has_renderer_enabled_in_view(view)
return None
示例4: is_enabled
# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import has_renderer_enabled_in_view [as 别名]
def is_enabled(self):
return RendererManager.has_renderer_enabled_in_view(self.view)