[Buildbot-commits] buildbot/buildbot master.py, 1.101, 1.102 scheduler.py, 1.22, 1.23 twcompat.py, 1.9, 1.10

Brian Warner warner at users.sourceforge.net
Mon Dec 11 08:40:19 UTC 2006


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

Modified Files:
	master.py scheduler.py twcompat.py 
Log Message:
[project @ more post-Twisted-1.3.0 cleanup: remove twcompat.providedBy, use zope.interface native methods instead]

Original author: warner at lothar.com
Date: 2006-12-11 08:34:42

Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- master.py	24 Nov 2006 08:23:27 -0000	1.101
+++ master.py	11 Dec 2006 08:40:17 -0000	1.102
@@ -874,11 +874,8 @@
         return d
 
     def allSchedulers(self):
-        # TODO: when twisted-1.3 compatibility is dropped, switch to the
-        # providedBy form, because it's faster (no actual adapter lookup)
         return [child for child in self
-                #if interfaces.IScheduler.providedBy(child)]
-                if interfaces.IScheduler(child, None)]
+                if interfaces.IScheduler.providedBy(child)]
 
 
     def loadConfig_Schedulers(self, newschedulers):

Index: scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scheduler.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- scheduler.py	26 Nov 2006 08:05:24 -0000	1.22
+++ scheduler.py	11 Dec 2006 08:40:17 -0000	1.23
@@ -11,7 +11,7 @@
 
 from buildbot import interfaces, buildset, util, pbutil
 from buildbot.status import builder
-from buildbot.twcompat import implements, providedBy
+from buildbot.twcompat import implements
 from buildbot.sourcestamp import SourceStamp
 from buildbot.changes import maildirtwisted
 
@@ -290,7 +290,7 @@
     compare_attrs = ('name', 'upstream', 'builders')
 
     def __init__(self, name, upstream, builderNames):
-        assert providedBy(upstream, interfaces.IUpstreamScheduler)
+        assert interfaces.IUpstreamScheduler.providedBy(upstream)
         BaseUpstreamScheduler.__init__(self, name)
         self.upstream = upstream
         self.builderNames = builderNames

Index: twcompat.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/twcompat.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- twcompat.py	11 Dec 2006 08:23:29 -0000	1.9
+++ twcompat.py	11 Dec 2006 08:40:17 -0000	1.10
@@ -17,10 +17,6 @@
 Interface:
     from buildbot.tcompat import Interface
     class IFoo(Interface)
-
-providedBy:
-    from buildbot.tcompat import providedBy
-    assert providedBy(obj, IFoo)
 """
 
 import os
@@ -34,12 +30,9 @@
     # yes
     from zope.interface import implements
     from zope.interface import Interface
-    def providedBy(obj, iface):
-        return iface.providedBy(obj)
 else:
     # nope
     from twisted.python.components import Interface
-    providedBy = components.implements
 
 # 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