如何在wxGlade创建的文件中插入版权声明?

发布于 2024-07-09 11:16:25 字数 347 浏览 7 评论 0原文

我使用 wxGlade 创建 Python 脚本,该脚本使用 wxWidgets。 wxGlade 直接操作 XML 文件,这些文件描述了基于 wxWidgets 的 GUI。 这些文件的扩展名为 *.wxg。 从 *.wxg 文件中,可以生成实际以多种语言之一运行 GUI 的代码,我正在使用它来生成 Python 代码。

我想向我的 *.wxg 文件以及生成的代码添加版权声明。 我尝试手动编辑 *.wxg 文件并将我的版权声明添加为 HTML 注释,但是在 wxGlade 中编辑该文件并保存编辑后的版本后,我的注释消失了。

如何在每次从 wxGlade 保存后不手动编辑这些文件的情况下向这些文件添加版权声明?

I use wxGlade to create Python scripts, which use wxWidgets.
wxGlade directly manipulates XML files, which describe the wxWidgets based GUI. Those files have the *.wxg extension.
From the *.wxg files, it is possible to generate code which actually runs the GUI in one of several languages, and I am using it to generate Python code.

I would like to add a copyright statement to my *.wxg files and also to the generated code.
I tried to hand-edit a *.wxg file and added my copyright statement as a HTML comment, but after editing the file in wxGlade and saving the edited version, my comment disappearesd.

How can I add a copyright statement to those files without hand-editing them after each save from wxGlade?

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

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

发布评论

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

评论(1

听风念你 2024-07-16 11:16:25

要将版权声明添加到 wxGlade 生成的文件中,您必须手动插入版权声明。 您必须对生成的每个文件执行此操作。 确保不必每次生成文件时都执行此操作的技巧是执行以下操作:

  1. 第一次生成源代码
  2. 将版权声明添加到文件
  3. 如果 wxGlade 尚未自动完成,请将 wxGlade 生成的代码括起来

    # 开始 wxGlade: 
      # 结束wxGlade 
      
  4. 确保未选中“覆盖现有源”复选框(右键单击树顶部的应用程序,在应用程序属性的底部,您将找到此复选框)

如果您对有关此内容的更多信息感兴趣,请查看 此页面 - 第 9 节。 Notes 包含您想要的信息(抱歉,无法链接到此部分,因为没有锚点)。

To add a copyright statement to a file generated by wxGlade, you will have to insert the copyright statement by hand. You will have to do this to every file generated. The trick to making sure that you don't have to do it every time you generate the file, is to do the following:

  1. Generate your source code the first time
  2. Add your copyright statement to the file
  3. If it isn't already done automatically by wxGlade, surround the wxGlade-generated code with

    # begin wxGlade:
    # end wxGlade
    
  4. Make sure that the checkbox "Overwrite existing sources" is unchecked (right click the application at the top of the tree, and at the bottom of the application properties you will find this checkbox)

If you are interested in more information about this, have a look at this page - section 9. Notes has the information you want (sorry, can't link to this section since there is no anchor for it).

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