我有一个大型的多文件Python应用程序,我想以图形方式进行文档记录.但首先,我制作了一个小的"虚拟"应用程序来测试不同的UML包.(注意:我确实安装了graph viz并在路径中).
这是我的"哑巴"代码:
class User:
def __init__(self, level_security=0):
self.level_security = level_security
def level_security_increment(level_security):
level_security += 1
return level_security
def printNice(aValue):
if type(aValue) != "str":
print(str(aValue))
else:
print(aValue)
return
def main():
printNice("Process start")
for x in range(0,9):
printNice(x)
myUser = User(3)
printNice(f"Sec lvl: {myUser.level_security}")
printNice("Process_done")
if __name__ == "__main__":
main()
下面是我用来获得不同图表的不同的pyverse命令行代码.我将把最接近我想要的图表贴在这些代码下面:
pyreverse test.py -S -m y -A -o png
pyreverse -ASmn test.py -b -o vdx
pyreverse -ASmy test.py -o emf
pyreverse -AS -m y test.py -o emf
pyreverse -p test.py -o emf
pyreverse -AS -b test.py -o emf
pyreverse -ASmy test.py -b -o png <-- closest
Now here is what that last one you see above produces:
最后,如果不清楚,我将重申我要表明的want点: 类、定义(函数)和变量(如果可能的话).但我现在很高兴只得到类和定义(函数).需要说明的是:我希望看到函数名称.
这是否与向pyverse命令添加/删除switch 一样简单?或者有什么包需要添加到我的"虚拟"代码中吗?