[Buildbot-commits] buildbot/buildbot/status base.py, 1.5, 1.6 builder.py, 1.92, 1.93 client.py, 1.28, 1.29 html.py, 1.93, 1.94 mail.py, 1.30, 1.31 tinderbox.py, 1.3, 1.4
Brian Warner
warner at users.sourceforge.net
Mon Dec 11 09:06:38 UTC 2006
Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19328/buildbot/status
Modified Files:
base.py builder.py client.py html.py mail.py tinderbox.py
Log Message:
[project @ get implements() from zope.interface directly, not from twcompat]
Original author: warner at lothar.com
Date: 2006-12-11 08:53:40
Index: base.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/base.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- base.py 6 Sep 2006 00:41:55 -0000 1.5
+++ base.py 11 Dec 2006 09:06:35 -0000 1.6
@@ -1,16 +1,13 @@
#! /usr/bin/python
+from zope.interface import implements
from twisted.application import service
-from buildbot.twcompat import implements
from buildbot.interfaces import IStatusReceiver
from buildbot import util, pbutil
class StatusReceiver:
- if implements:
- implements(IStatusReceiver)
- else:
- __implements__ = IStatusReceiver,
+ implements(IStatusReceiver)
def buildsetSubmitted(self, buildset):
pass
@@ -53,18 +50,12 @@
class StatusReceiverMultiService(StatusReceiver, service.MultiService,
util.ComparableMixin):
- if implements:
- implements(IStatusReceiver)
- else:
- __implements__ = IStatusReceiver, service.MultiService.__implements__
+ implements(IStatusReceiver)
def __init__(self):
service.MultiService.__init__(self)
class StatusReceiverPerspective(StatusReceiver, pbutil.NewCredPerspective):
- if implements:
- implements(IStatusReceiver)
- else:
- __implements__ = (IStatusReceiver,
- pbutil.NewCredPerspective.__implements__)
+ implements(IStatusReceiver)
+
Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- builder.py 11 Dec 2006 08:40:17 -0000 1.92
+++ builder.py 11 Dec 2006 09:06:35 -0000 1.93
@@ -2,6 +2,7 @@
from __future__ import generators
+from zope.interface import implements
from twisted.python import log
from twisted.persisted import styles
from twisted.internet import reactor, defer
@@ -20,7 +21,6 @@
# sibling imports
from buildbot import interfaces, util, sourcestamp
-from buildbot.twcompat import implements
SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION = range(5)
Results = ["success", "warnings", "failure", "skipped", "exception"]
@@ -205,10 +205,7 @@
so users who go from 0.6.5 back to 0.6.4 don't have to lose their
logs."""
- if implements:
- implements(interfaces.IStatusLog, interfaces.ILogFile)
- else:
- __implements__ = (interfaces.IStatusLog, interfaces.ILogFile)
+ implements(interfaces.IStatusLog, interfaces.ILogFile)
finished = False
length = 0
@@ -462,10 +459,7 @@
class HTMLLogFile:
- if implements:
- implements(interfaces.IStatusLog)
- else:
- __implements__ = interfaces.IStatusLog,
+ implements(interfaces.IStatusLog)
filename = None
@@ -512,10 +506,7 @@
class Event:
- if implements:
- implements(interfaces.IStatusEvent)
- else:
- __implements__ = interfaces.IStatusEvent,
+ implements(interfaces.IStatusEvent)
started = None
finished = None
@@ -536,10 +527,7 @@
self.finished = util.now()
class TestResult:
- if implements:
- implements(interfaces.ITestResult)
- else:
- __implements__ = interfaces.ITestResult,
+ implements(interfaces.ITestResult)
def __init__(self, name, results, text, logs):
assert isinstance(name, tuple)
@@ -562,10 +550,7 @@
class BuildSetStatus:
- if implements:
- implements(interfaces.IBuildSetStatus)
- else:
- __implements__ = interfaces.IBuildSetStatus,
+ implements(interfaces.IBuildSetStatus)
def __init__(self, source, reason, builderNames, bsid=None):
self.source = source
@@ -631,10 +616,7 @@
return d
class BuildRequestStatus:
- if implements:
- implements(interfaces.IBuildRequestStatus)
- else:
- __implements__ = interfaces.IBuildRequestStatus,
+ implements(interfaces.IBuildRequestStatus)
def __init__(self, source, builderName):
self.source = source
@@ -684,10 +666,7 @@
"""
# note that these are created when the Build is set up, before each
# corresponding BuildStep has started.
- if implements:
- implements(interfaces.IBuildStepStatus, interfaces.IStatusEvent)
- else:
- __implements__ = interfaces.IBuildStepStatus, interfaces.IStatusEvent
+ implements(interfaces.IBuildStepStatus, interfaces.IStatusEvent)
persistenceVersion = 1
started = None
@@ -917,10 +896,7 @@
class BuildStatus(styles.Versioned):
- if implements:
- implements(interfaces.IBuildStatus, interfaces.IStatusEvent)
- else:
- __implements__ = interfaces.IBuildStatus, interfaces.IStatusEvent
+ implements(interfaces.IBuildStatus, interfaces.IStatusEvent)
persistenceVersion = 2
source = None
@@ -1317,10 +1293,7 @@
used to filter on in status clients
"""
- if implements:
- implements(interfaces.IBuilderStatus)
- else:
- __implements__ = interfaces.IBuilderStatus,
+ implements(interfaces.IBuilderStatus)
persistenceVersion = 1
# these limit the amount of memory we consume, as well as the size of the
@@ -1720,10 +1693,7 @@
self.subscribers.remove(client)
class SlaveStatus:
- if implements:
- implements(interfaces.ISlaveStatus)
- else:
- __implements__ = interfaces.ISlaveStatus,
+ implements(interfaces.ISlaveStatus)
admin = None
host = None
@@ -1752,10 +1722,7 @@
"""
I represent the status of the buildmaster.
"""
- if implements:
- implements(interfaces.IStatus)
- else:
- __implements__ = interfaces.IStatus,
+ implements(interfaces.IStatus)
def __init__(self, botmaster, basedir):
"""
Index: client.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- client.py 11 Dec 2006 08:46:39 -0000 1.28
+++ client.py 11 Dec 2006 09:06:35 -0000 1.29
@@ -7,8 +7,7 @@
from twisted.cred import portal, checkers
from buildbot import interfaces
-from zope.interface import Interface
-from buildbot.twcompat import implements
+from zope.interface import Interface, implements
from buildbot.status import builder, base
from buildbot.changes import changes
@@ -538,11 +537,7 @@
"""I am a listener for PB-based status clients."""
compare_attrs = ["port", "cred"]
- if implements:
- implements(portal.IRealm)
- else:
- __implements__ = (portal.IRealm,
- base.StatusReceiverMultiService.__implements__)
+ implements(portal.IRealm)
def __init__(self, port, user="statusClient", passwd="clientpw"):
base.StatusReceiverMultiService.__init__(self)
Index: html.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- html.py 11 Dec 2006 08:46:39 -0000 1.93
+++ html.py 11 Dec 2006 09:06:35 -0000 1.94
@@ -12,8 +12,7 @@
from twisted.web.util import Redirect, DeferredResource
from twisted.application import strports
from twisted.spread import pb
-from zope.interface import Interface
-from buildbot.twcompat import implements
+from zope.interface import Interface, implements
import sys, string, types, time, os.path
@@ -691,10 +690,7 @@
"""
class ChunkConsumer:
- if implements:
- implements(interfaces.IStatusLogConsumer)
- else:
- __implements__ = interfaces.IStatusLogConsumer,
+ implements(interfaces.IStatusLogConsumer)
def __init__(self, original, textlog):
self.original = original
@@ -716,10 +712,7 @@
class TextLog(Resource):
# a new instance of this Resource is created for each client who views
# it, so we can afford to track the request in the Resource.
- if implements:
- implements(IHTMLLog)
- else:
- __implements__ = IHTMLLog,
+ implements(IHTMLLog)
asText = False
subscribed = False
@@ -803,11 +796,7 @@
class HTMLLog(Resource):
- if implements:
- implements(IHTMLLog)
- else:
- __implements__ = IHTMLLog,
-
+ implements(IHTMLLog)
def __init__(self, original):
Resource.__init__(self)
@@ -822,10 +811,7 @@
class CurrentBox(components.Adapter):
# this provides the "current activity" box, just above the builder name
- if implements:
- implements(ICurrentBox)
- else:
- __implements__ = ICurrentBox,
+ implements(ICurrentBox)
def formatETA(self, eta):
if eta is None:
@@ -899,10 +885,7 @@
components.registerAdapter(CurrentBox, builder.BuilderStatus, ICurrentBox)
class ChangeBox(components.Adapter):
- if implements:
- implements(IBox)
- else:
- __implements__ = IBox,
+ implements(IBox)
def getBox(self):
url = "changes/%d" % self.original.number
@@ -912,10 +895,7 @@
class BuildBox(components.Adapter):
# this provides the yellow "starting line" box for each build
- if implements:
- implements(IBox)
- else:
- __implements__ = IBox,
+ implements(IBox)
def getBox(self):
b = self.original
@@ -937,10 +917,7 @@
components.registerAdapter(BuildBox, builder.BuildStatus, IBox)
class StepBox(components.Adapter):
- if implements:
- implements(IBox)
- else:
- __implements__ = IBox,
+ implements(IBox)
def getBox(self):
b = self.original.getBuild()
@@ -972,10 +949,7 @@
components.registerAdapter(StepBox, builder.BuildStepStatus, IBox)
class EventBox(components.Adapter):
- if implements:
- implements(IBox)
- else:
- __implements__ = IBox,
+ implements(IBox)
def getBox(self):
text = self.original.getText()
@@ -990,10 +964,7 @@
class BuildTopBox(components.Adapter):
# this provides a per-builder box at the very top of the display,
# showing the results of the most recent build
- if implements:
- implements(IBox)
- else:
- __implements__ = IBox,
+ implements(IBox)
def getBox(self):
assert interfaces.IBuilderStatus(self.original)
@@ -1017,10 +988,7 @@
self.finished = finish
class SpacerBox(components.Adapter):
- if implements:
- implements(IBox)
- else:
- __implements__ = IBox,
+ implements(IBox)
def getBox(self):
#b = Box(["spacer"], "white")
Index: mail.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/mail.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- mail.py 11 Dec 2006 08:49:40 -0000 1.30
+++ mail.py 11 Dec 2006 09:06:35 -0000 1.31
@@ -12,21 +12,18 @@
canDoAttachments = False
import urllib
+from zope.interface import implements
from twisted.internet import defer
from twisted.mail.smtp import sendmail
from twisted.python import log
from buildbot import interfaces, util
-from buildbot.twcompat import implements
from buildbot.status import base
from buildbot.status.builder import FAILURE, SUCCESS, WARNINGS
class Domain(util.ComparableMixin):
- if implements:
- implements(interfaces.IEmailLookup)
- else:
- __implements__ = interfaces.IEmailLookup
+ implements(interfaces.IEmailLookup)
compare_attrs = ["domain"]
def __init__(self, domain):
@@ -56,11 +53,7 @@
MailNotifiers.
"""
- if implements:
- implements(interfaces.IEmailSender)
- else:
- __implements__ = (interfaces.IEmailSender,
- base.StatusReceiverMultiService.__implements__)
+ implements(interfaces.IEmailSender)
compare_attrs = ["extraRecipients", "lookup", "fromaddr", "mode",
"categories", "builders", "addLogs", "relayhost",
Index: tinderbox.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/tinderbox.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- tinderbox.py 5 Nov 2006 05:13:06 -0000 1.3
+++ tinderbox.py 11 Dec 2006 09:06:35 -0000 1.4
@@ -2,10 +2,10 @@
from email.Message import Message
from email.Utils import formatdate
+from zope.interface import implements
from twisted.internet import defer
from buildbot import interfaces
-from buildbot.twcompat import implements
from buildbot.status import base, mail
from buildbot.status.builder import SUCCESS, WARNINGS
@@ -29,11 +29,7 @@
tinderbox option.
"""
- if implements:
- implements(interfaces.IEmailSender)
- else:
- __implements__ = (interfaces.IEmailSender,
- base.StatusReceiverMultiService.__implements__)
+ implements(interfaces.IEmailSender)
compare_attrs = ["extraRecipients", "fromaddr", "categories", "builders",
"addLogs", "relayhost", "subject", "binaryURL", "tree",
More information about the Commits
mailing list