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


Python Scene.add_scene方法代码示例

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


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

示例1: _process_code

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import add_scene [as 别名]
  def _process_code(self, div):
    """ Process a code div, returning a scene and the frames referenced.
    """
    frames = []

    scene = Scene()
    scene.set_type("code")

    coqdoc = []
    for child in div:
      coqdoc.append(child)
      commands = self._find_commands(child)
      if commands and self.isCommand(commands[0]):
        command = self._replace_html(commands[0])
        response = self._prover.send(
                             command.encode(self._coqdoc_tree.originalEncoding))

        frame = Coqdoc_Frame(command = command, command_cd = coqdoc,
                           response = response)
        frames.append(frame)
        scene.add_scene(frame)

        coqdoc = []

    trailing_frame = Coqdoc_Frame(command = ''.join([str(el) for el in coqdoc]),
                                  command_cd = coqdoc,
                                  response = None)
    frames.append(trailing_frame)
    scene.add_scene(trailing_frame)

    return frames, scene
开发者ID:JasonGross,项目名称:proviola-source,代码行数:33,代码来源:coqdoc_reader.py

示例2: _process_doc

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import add_scene [as 别名]
  def _process_doc(self, div):
    frames = []
    scene = Scene()
    scene.set_type("doc")
    scene.set_attributes(div.attrs)

    for child in div:
      try:
        child_name = child.name
      except AttributeError:
        child_name = "text"
        child.text = str(child)

      if child_name == "div":
        if div.get("class") == "doc":
          child_frames, child_scene = self._process_doc(child)
        else:
          child_frames, child_scene = self._process_div(child)

      else:
        child_scene = Coqdoc_Frame(command = child.text, command_cd = [child],
                               response = None)
        child_frames = [child_scene]

      frames += child_frames
      scene.add_scene(child_scene)

    return frames, scene
开发者ID:JasonGross,项目名称:proviola-source,代码行数:30,代码来源:coqdoc_reader.py


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