[Buildbot-commits] buildbot/buildbot master.py, 1.102, 1.103 scheduler.py, 1.23, 1.24 sourcestamp.py, 1.2, 1.3 twcompat.py, 1.11, 1.12

Brian Warner warner at users.sourceforge.net
Mon Dec 11 09:06:36 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19328/buildbot

Modified Files:
	master.py scheduler.py sourcestamp.py twcompat.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: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- master.py	11 Dec 2006 08:40:17 -0000	1.102
+++ master.py	11 Dec 2006 09:06:34 -0000	1.103
@@ -12,6 +12,7 @@
 except ImportError:
     import pickle
 
+from zope.interface import implements
 from twisted.python import log, components
 from twisted.internet import defer, reactor
 from twisted.spread import pb
@@ -20,7 +21,6 @@
 from twisted.persisted import styles
 
 # sibling imports
-from buildbot.twcompat import implements
 from buildbot.util import now
 from buildbot.pbutil import NewCredPerspective
 from buildbot.process.builder import Builder, IDLE
@@ -432,10 +432,7 @@
         print "debug", msg
 
 class Dispatcher(styles.Versioned):
-    if implements:
-        implements(portal.IRealm)
-    else:
-        __implements__ = portal.IRealm,
+    implements(portal.IRealm)
     persistenceVersion = 2
 
     def __init__(self):
@@ -999,10 +996,7 @@
 
 
 class Control:
-    if implements:
-        implements(interfaces.IControl)
-    else:
-        __implements__ = interfaces.IControl,
+    implements(interfaces.IControl)
 
     def __init__(self, master):
         self.master = master

Index: scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scheduler.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- scheduler.py	11 Dec 2006 08:40:17 -0000	1.23
+++ scheduler.py	11 Dec 2006 09:06:34 -0000	1.24
@@ -2,6 +2,7 @@
 
 import time, os.path
 
+from zope.interface import implements
 from twisted.internet import reactor
 from twisted.application import service, internet, strports
 from twisted.python import log, runtime
@@ -11,17 +12,12 @@
 
 from buildbot import interfaces, buildset, util, pbutil
 from buildbot.status import builder
-from buildbot.twcompat import implements
 from buildbot.sourcestamp import SourceStamp
 from buildbot.changes import maildirtwisted
 
 
 class BaseScheduler(service.MultiService, util.ComparableMixin):
-    if implements:
-        implements(interfaces.IScheduler)
-    else:
-        __implements__ = (interfaces.IScheduler,
-                          service.MultiService.__implements__)
+    implements(interfaces.IScheduler)
 
     def __init__(self, name):
         service.MultiService.__init__(self)
@@ -38,11 +34,7 @@
         pass
 
 class BaseUpstreamScheduler(BaseScheduler):
-    if implements:
-        implements(interfaces.IUpstreamScheduler)
-    else:
-        __implements__ = (interfaces.IUpstreamScheduler,
-                          BaseScheduler.__implements__)
+    implements(interfaces.IUpstreamScheduler)
 
     def __init__(self, name):
         BaseScheduler.__init__(self, name)
@@ -518,11 +510,7 @@
 
 
 class TryBase(service.MultiService, util.ComparableMixin):
-    if implements:
-        implements(interfaces.IScheduler)
-    else:
-        __implements__ = (interfaces.IScheduler,
-                          service.MultiService.__implements__)
+    implements(interfaces.IScheduler)
 
     def __init__(self, name, builderNames):
         service.MultiService.__init__(self)
@@ -638,12 +626,7 @@
 
 class Try_Userpass(TryBase):
     compare_attrs = ["name", "builderNames", "port", "userpass"]
-
-    if implements:
-        implements(portal.IRealm)
-    else:
-        __implements__ = (portal.IRealm,
-                          TryBase.__implements__)
+    implements(portal.IRealm)
 
     def __init__(self, name, builderNames, port, userpass):
         TryBase.__init__(self, name, builderNames)

Index: sourcestamp.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/sourcestamp.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sourcestamp.py	12 Mar 2006 11:28:04 -0000	1.2
+++ sourcestamp.py	11 Dec 2006 09:06:34 -0000	1.3
@@ -1,6 +1,6 @@
 
+from zope.interface import implements
 from buildbot import util, interfaces
-from buildbot.twcompat import implements
 
 class SourceStamp(util.ComparableMixin):
     """This is a tuple of (branch, revision, patchspec, changes).
@@ -27,10 +27,7 @@
 
     compare_attrs = ('branch', 'revision', 'patch', 'changes')
 
-    if implements:
-        implements(interfaces.ISourceStamp)
-    else:
-        __implements__ = interfaces.ISourceStamp,
+    implements(interfaces.ISourceStamp)
 
     def __init__(self, branch=None, revision=None, patch=None,
                  changes=None):

Index: twcompat.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/twcompat.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- twcompat.py	11 Dec 2006 08:46:39 -0000	1.11
+++ twcompat.py	11 Dec 2006 09:06:34 -0000	1.12
@@ -5,33 +5,11 @@
 """
 utilities to be compatible with both Twisted-1.3 and 2.0
 
-implements. Use this like the following.
-
-from buildbot.twcompat import implements
-class Foo:
-    if implements:
-        implements(IFoo)
-    else:
-        __implements__ = IFoo,
-        
-Interface:
-    from buildbot.tcompat import Interface
-    class IFoo(Interface)
 """
 
 import os
 
 from twisted.copyright import version
-from twisted.python import components
-
-# does our Twisted use zope.interface?
-implements = None
-if hasattr(components, "interface"):
-    # yes
-    from zope.interface import implements
-else:
-    # nope
-    pass
 
 # waitForDeferred and getProcessOutputAndValue are twisted-2.0 things. If
 # we're running under 1.3, patch them into place. These versions are copied





More information about the Commits mailing list