在找代码生成uml图工具的时候,发现了这个小工具
安装它也很简单,前提是已经安装好了python,并且已经有了pip
安装
我是在windows下安装的:
首先安装 Tkinter
然后安装Swampy 它包含了Lumpy,并且它里面有一些有意思的程序
pip install swampy
具体安装可以参照官方主页:
http://www.greenteapress.com/thinkpython/swampy/install.html
测试
安装完了就可以用它生成简单的类图了:
下面是我再看robotframework代码时,参数解析类之间关系的代码,新建一个对象,Lumpy就会把它的对象关系和类关系图绘制出来,虽然不是很好看,但至少能够看到类,对象之间大概的轮廓。
__author__ = 'Thomas'
from swampy import Lumpy
USAGE = '''
-N --name name Set the name of the top level test suite. Underscores
in the name are converted to spaces. Default name is
created from the name of the executed data source.
-D --doc documentation Set the documentation of the top level te
'''
lumpy = Lumpy.Lumpy()
lumpy.make_reference()
from robot.utils import Application
application = Application(USAGE, '/HELLO/WORLD',
env_options='ROBOT_OPTIONS')
lumpy.object_diagram()
lumpy.class_diagram()
结果
运行完的对象图:
运行完的类图: