当前位置: 首页>>代码示例>>Python>>正文


Python RendererManager.any_available_renderer_for_view方法代码示例

本文整理汇总了Python中OmniMarkupLib.RendererManager.RendererManager.any_available_renderer_for_view方法的典型用法代码示例。如果您正苦于以下问题:Python RendererManager.any_available_renderer_for_view方法的具体用法?Python RendererManager.any_available_renderer_for_view怎么用?Python RendererManager.any_available_renderer_for_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OmniMarkupLib.RendererManager.RendererManager的用法示例。


在下文中一共展示了RendererManager.any_available_renderer_for_view方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: put

# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import any_available_renderer_for_view [as 别名]
    def put(self, view, preemptive=True, timeout=0.5):
        if not RendererManager.any_available_renderer_for_view(view):
            return

        view_id = view.id()
        now = time.time()

        with self.mutex:
            if view_id in self.view_entry_mapping:
                # Too fast, cancel this operation
                if now - self.last_signaled <= 0.01:
                    return

        if preemptive:
            # Cancel pending actions
            with self.cond:
                if view_id in self.view_entry_mapping:
                    del self.view_entry_mapping[view_id]
                    self.cond.notify()
            RendererManager.enqueue_view(view, only_exists=True)
            self.last_signaled = now
        else:
            with self.cond:
                filename = view.file_name()
                if view_id not in self.view_entry_mapping:
                    self.view_entry_mapping[view_id] = self.Entry(view, timeout)
                else:
                    entry = self.view_entry_mapping[view_id]
                    entry.view = view
                    entry.filename = filename
                    entry.timeout = timeout
                self.cond.notify()
开发者ID:hsp86,项目名称:sublime_text3_configure,代码行数:34,代码来源:OmniMarkupPreviewer.py

示例2: on_query_context

# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import any_available_renderer_for_view [as 别名]
 def on_query_context(self, view, key, operator, operand, match_all):
     # `omp_is_enabled` for backwards compatibility
     if key == 'omnimarkup_is_enabled' or key == 'omp_is_enabled':
         return RendererManager.any_available_renderer_for_view(view)
     return None
开发者ID:hsp86,项目名称:sublime_text3_configure,代码行数:7,代码来源:OmniMarkupPreviewer.py

示例3: enqueue_view_to_renderer_manager

# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import any_available_renderer_for_view [as 别名]
 def enqueue_view_to_renderer_manager(self, view, filename):
     if view.is_loading() or view.file_name() != filename:
         return
     if RendererManager.any_available_renderer_for_view(view):
         RendererManager.enqueue_view(view, only_exists=True)
         self.last_signaled = time.time()
开发者ID:hsp86,项目名称:sublime_text3_configure,代码行数:8,代码来源:OmniMarkupPreviewer.py

示例4: is_visible

# 需要导入模块: from OmniMarkupLib.RendererManager import RendererManager [as 别名]
# 或者: from OmniMarkupLib.RendererManager.RendererManager import any_available_renderer_for_view [as 别名]
 def is_visible(self):
     return RendererManager.any_available_renderer_for_view(self.view)
开发者ID:hsp86,项目名称:sublime_text3_configure,代码行数:4,代码来源:OmniMarkupPreviewer.py


注:本文中的OmniMarkupLib.RendererManager.RendererManager.any_available_renderer_for_view方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。