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