svg.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:vPiP 作者: brianinnes 项目源码 文件源码
def createDrawingCoords(self):
        if self.drawingCoords is None:
            self.drawingCoords = []
            self.pathIterator = self._tokenize_path(self.d)
            while True:
                try:
                    command = next(self.pathIterator)
                    if not command in self.COMMANDS:
                        self.additionalParameter = float(command)
                        coord = self.svgAdditionalCoords.get(self.currentCommand)()
                    else:
                        coord = self.svgPathSegmentCommands.get(command.strip(), self.unknownCommand)()
                        self.currentCommand = command.strip()
                    if coord is not None:
                        self.drawingCoords.append(coord)
                except StopIteration:
                    break
                except:
                    exc_type, exc_value, exc_traceback = sys.exc_info()
                    print("test1 main thread exception : %s" % exc_type)
                    traceback.print_tb(exc_traceback, limit=2, file=sys.stdout)
        return self.drawingCoords
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号