我是 Python 的新手。我想创建一个 python 脚本,它检查(也许解析)每个提交的 xml 文件以获取特殊标签的可用性(例如 status="Needs Review")。如果 xml 文件包含此标记,则发送一封电子邮件,其中包含指向该主题的链接。如果不继续提交而不发送任何电子邮件。
是否有人有代码示例如何将其实现为 python 脚本。xml 文件样本:
<topic template="Default" status="Needs Review" lasteditedby="user1">
<title translate="true">Sample Title</title>
<body>
<header>
<para styleclass="Heading1"><text styleclass="Heading1" translate="true">Statistische Messungen</text></para>
</header>
<para styleclass="Normal"><text styleclass="Font Style" style="font-family:'Optima LT'; font-size:10pt; font-weight:normal; font-style:normal; text-decoration:none; text-transform:none; vertical-align:baseline; color:#000000; background-color:transparent; letter-spacing:normal; letter-scaling:100%;" translate="true">This is a sample Text</text></para>
</body>
</topic>
我想有不同的方法可以做到这一点,我知道有一些用于 post-commits 的 python 编码,但我找不到这个问题的编码。