本文整理汇总了Python中Camera.Camera.cleanup方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.cleanup方法的具体用法?Python Camera.cleanup怎么用?Python Camera.cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera.Camera
的用法示例。
在下文中一共展示了Camera.cleanup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SVGBuild
# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import cleanup [as 别名]
#.........这里部分代码省略.........
self.options['height'] = self.svg.root.attrib['height']
except Exception as e:
print 'error'
self.finished.emit()
return
if self.options['fullpath']:
defs_element = self.svg.root.find('{http://www.w3.org/2000/svg}defs')
markers = defs_element.findall('{http://www.w3.org/2000/svg}marker')
if len(markers) == 0:
self.addMarker(defs_element, self.options['marker'])
else:
self.marker = '%s' % markers[0].attrib['id']
self.printText.emit('Surveyed %d elements.' % elementCount)
self.camera = Camera(self.options)
self.camera.printText.connect(self.printText)
# self.finished.emit()
# return 0
if self.camera.survey(self.svg):
#self.printText.emit('ok')
self.camera.move(self.svg.root.attrib['id'])
self.build(self.svg, self.camera, self.svg.root, self.options)
if self.isRunning:
self.printText.emit('Finishing...')
self.options['camera'] = False
self.camera.shoot(self.svg)
self.camera.hold(self.options['hold'])
self.camera.cleanup()
else:
self.printText.emit('Canceled...')
finish = time.time()
hours = int((finish - start) / 60) / 60
minutes = int((finish - start) / 60) % 60
folder = self.options['folder']
self.printText.emit('Finished %s to %s in %dh:%02dm.' % (self.filename, folder, hours, minutes))
self.finished.emit()
def build(self, svg, camera, entity, options):
'''Recursively build up the given entity, by removing all its children
and adding them back in one at a time, and shooting the progress with
the given camera.
'''
if not self.isRunning: return
id = entity.attrib['id']
name = id
label = 'http://www.inkscape.org/namespaces/inkscape}label'
if label in entity.attrib:
name = entity.attrib[label]
print '%05d - Building up <%s id="%s"> (%s)...' % (camera.time, entity.tag, id, name)
self.printText.emit('%05d - Building up <%s id="%s"> (%s)...' % (camera.time, entity.tag, id, name))
nobuild = set([ '{http://www.w3.org/2000/svg}defs',
'{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}namedview',
'{http://www.w3.org/2000/svg}metadata',
])