Eclipse控制台中的Pydev源文件超链接 [英] Pydev source file hyperlinks in Eclipse console

查看:95
本文介绍了Eclipse控制台中的Pydev源文件超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当python应用程序崩溃时,控制台会显示到发生异常的源代码的超链接。您只需单击链接,然后在Eclipse编辑器中打开您的源文件。

When a python app crashes the console displays hyperlinks to the source code where the exceptions occurred. You just click the link and your source file is opened in the Eclipse editor.

我有自己的异常处理程序,想在当控制台添加指向源文件的链接时我的应用程序崩溃了。

I have my own exception handler and would like to put links to source files in the console when my apps crash.

我已经寻找了好几次有关此信息,却看不到该怎么做或根本不可能。

I have looked for info on this a few times and cannot see how to do it or if it is possible at all.

似乎可以在Java中通过以':'形式写入控制台来完成-侦听器将其选中并将其转换为可点击的链接。

It seems that it can be done in java by writing to the console in the form ':' - A listener picks this up and converts it to a clickable link. This does not work in Python.

有什么想法吗?

推荐答案

如果要在PyDev中放置可单击的链接,则必须使用Python中提供的相同方法。

If you want to put links to be clickable in PyDev, you have to do it in the same way that's presented in Python.

即:您可以从 https://github.com/fabioz/Pydev/blob/master/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/PythonConsoleLineTracker.java 表示它的模式匹配项是:

I.e.: You can see from https://github.com/fabioz/Pydev/blob/master/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/PythonConsoleLineTracker.java that the pattern it matches is:

。*(文件)\\\([[^ \\\] *)\ \\\,第(\\d *)行。

(请注意 \ 是Java上字符串中的转义符。

(note that \ is the escape in a string on on java).

这篇关于Eclipse控制台中的Pydev源文件超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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