pyreverse 不绘制关系/箭头/连接 [英] pyreverse doesn't draw relationships/arrows/connections

查看:40
本文介绍了pyreverse 不绘制关系/箭头/连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我有点让 Pyreverse 工作了,它现在显示我的课程,但它没有在课程之间建立联系.

我在一堂课上得了

类网络服务器:打印('东西')getcaller1 = getcaller.GetCaller()device_dict = getcaller1.abc(m)

另一个包含

class GetCaller():定义 __init__():打印('初始化')def abc(self, m):设备=获取(米)

但是,我在 classes.png 中得到的只是这个(类之间没有线条或箭头)

代码有效,如果我在 pip 安装的模块上运行 pyreverse 的东西,pyreverse 确实会打印这些箭头,但我自己的项目中肯定缺少某些东西.python 类还可以有哪些其他类型的关系?

解决方案

新答案 我意识到问题摆在屏幕前.我没有使用任何类的对象,只有导入和带有返回值的静态方法调用.这样,我得到的图像(没有属性和函数名称等)在技术上是正确的图像.但是,如果您想欺骗自己的方式来可视化您的某些代码,请查看旧答案

旧答案:我不知道这是否是它应该工作的方式,但有效的是将类放在同一个文件中,也许它只搜索模块范围.>

Hey I kinda got Pyreverse to work, it's now showing my classes but it doesn't draw connections between the classes.

In one class I got

class webserver:
    print('stuff')
    getcaller1 = getcaller.GetCaller()
    device_dict = getcaller1.abc(m)

and the other one contains

class GetCaller():

    def __init__():
        print('init')

    def abc(self, m):

        devices=get(m)

However, all I am getting in my classes.png is this (no lines or arrows in between the classes)

The code works and if I run pyreverse stuff on pip-installed modules, pyreverse does print those arrows but there must be something I am missing in my own project. What other kind of relationships can python classes have?

解决方案

New answer I've realized that the problem sat in front of the screen. I haven't used any objects of classes, only imports and static method calls with return values. This way, the image that I got (without attributes and function names etc) technically was the correct image. However, if you want to cheat your way into it to visualize some of your code, check the old answer

Old answer: I have no idea if that's the way it's supposed to work like but what worked is to put the classes in the same file, maybe it only searches on module-scope.

这篇关于pyreverse 不绘制关系/箭头/连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆