WinCVS - Python - TCL

发布于 2024-10-21 14:00:41 字数 428 浏览 6 评论 0原文

我有一个 txt 文件中的文件列表,我需要在编辑模式下签出它们,并进行一些更改(有 word 文档),然后通过 WinCVS 将它们签入。

我知道我可以在 wincvs shell 中编写 tcl 脚本或宏或 python 脚本,但我对它们有一些问题。

我已经安装了 TCL 8.5 并在“管理”>“首选项”中选择了 tcl DLL,tcl 现在可用,但每当我键入并执行 tcl 脚本时,它都会显示

找不到名为“stdout”的通道

您对这个错误有什么想法吗?

另外,我看不到管理宏,它说 Shell 不可用。我已经安装了最新版本的python并在首选项中选择相关的dll。

谁能给我一个通过 wincvs 检查文件列表的提示?

预先非常感谢,

问候

I have got a list of files in txt files and I need to check them out in edit mode, and make some changes(there are word documents), and check them back in via WinCVS.

I know I can write tcl scripts or macro, or python scripts in wincvs shell but I have some problems with them.

I have installed TCL 8.5 and selected tcl DLL in Admin>Preferences, tcl is now available, but whenever I type and execute a tcl script, it says

can not find channel named "stdout"

Do you have any idea regarding this error?

Also, I cannot see admin macros, it says Shell is not available. I have installed the latest version of python and select related dll in preferences.

Could anyone give me a hint for checking a list of files via wincvs?

many thanks in advance,

regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

简单爱 2024-10-28 14:00:41

问题是 Tcl 试图将标准文件描述符构建到默认可用的通道中(即 stdinstdoutstderr),但是当默认情况下未打开它们时,就会出现问题。 Windows 上断开运行时就是这种情况(这是该平台上的 GUI 应用程序内部发生的情况)。当您使用完整的 Tcl shell(例如 wish)运行时,这是可以解决的,但是您是嵌入式的,因此这不起作用;修复问题的代码不会运行,因为它是 shell 启动的一部分,而不是库初始化的一部分(毕竟,在没有应用程序或用户询问的情况下,替换文件描述符等进程全局资源对于任何库来说都有点不友好到!)

最简单的解决方法是不写入 stdout – 请注意,它是 puts 命令的默认目标,因此您必须小心 – 并且注意不要也可以写入 stderr ,因为这可能受到相同的限制(这意味着您必须小心如何捕获错误,尤其是在测试脚本时)。

The problem is that Tcl's trying to build the standard file descriptors into available-by-default channels (i.e., stdin, stdout and stderr) but this goes wrong when they're not opened by default. That's the case on Windows when running disconnected (which is what happens inside GUI applications on that platform). When you're running with a full Tcl shell such as wish, this is worked around, but you're embedded so that's not going to work; the code to fix things isn't run because it's part of the shell startup and not the library initialization (after all, replacing a process-global resource like file descriptors is a little unfriendly for any library to do without the app or user asking it to!)

The simplest workaround is to not write to stdout – note that it's the default destination of the puts command, so you have to be careful – and to take care not to write to stderr either, as that's probably under the same restrictions (which means that you've got to be careful how you trap errors, especially while testing your script).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文