WinCVS - Python - TCL
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是 Tcl 试图将标准文件描述符构建到默认可用的通道中(即
stdin
、stdout
和stderr
),但是当默认情况下未打开它们时,就会出现问题。 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
andstderr
) 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 theputs
command, so you have to be careful – and to take care not to write tostderr
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).