我组织中的许多人的电子邮件名称与 perforce 名称不同,因此我需要创建一个覆盖 getAddress 的 IEmailLookup 派生来执行我的恶意竞标:
(来自我的 master.cfg)
class MyIEmailLookup:
from buildbot import interfaces
__implements__ = interfaces.IEmailLookup
def getAddresses(user):
address_dict = {"user1", "user_one@our_domain.com"}
try:
address = address_dict[user]
except KeyError:
address = user + "@our_domain.com"
return address
maillookup = MyIEmailLookup()
from buildbot.status import mail
c['status'].append(mail.MailNotifier(....
....
lookup=maillookup
))
我尝试了任意数量的排列,但我要么得到:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/runner.py", line 1071, in doCheckConfig
ConfigLoader(configFileName=configFileName)
File "/Library/Python/2.6/site-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/checkconfig.py", line 46, in __init__
self.loadConfig(configFile, check_synchronously_only=True)
File "/Library/Python/2.6/site-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/master.py", line 727, in loadConfig
exec f in localDict
File "/Users/playbuilder/buildbot/master.cfg", line 207, in <module>
lookup=maillookup
File "/Library/Python/2.6/site-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/status/mail.py", line 293, in __init__
assert interfaces.IEmailLookup.providedBy(lookup)
AssertionError
...或任何其他数量的问题,取决于我如何尝试实现 IEmailLookup 接口。
我正在使用 buildbot 0.8.3p1 和 python 2.6.1。
我看到很少有关于如何做到这一点的例子,而且在我的上下文中每个例子都失败了。我在这里想念什么?