[Buildbot-commits] buildbot/buildbot/process step.py,1.68,1.69

Fred L. Drake fdrake at users.sourceforge.net
Tue Sep 6 22:07:09 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/process
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26681/buildbot/process

Modified Files:
	step.py 
Log Message:
Add progressMetrics, description, descriptionDone to the 'parms' list,
and make use the 'parms' list from the implementation class instead of
only BuildStep to initialize the parameters.  This allows
buildbot.process.factory.s() to initialize all the parms, not just
those defined in directly by BuildStep.


Index: step.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- step.py	8 Aug 2005 21:39:45 -0000	1.68
+++ step.py	6 Sep 2005 22:07:07 -0000	1.69
@@ -408,7 +408,9 @@
              'flunkOnWarnings',
              'flunkOnFailure',
              'warnOnWarnings',
-             'warnOnFailure',]
+             'warnOnFailure',
+             'progressMetrics',
+             ]
 
     name = "generic"
     locks = []
@@ -420,7 +422,7 @@
 
     def __init__(self, **kwargs):
         self.build = kwargs['build'] # required
-        for p in BuildStep.parms:
+        for p in self.__class__.parms:
             if kwargs.has_key(p):
                 setattr(self, p, kwargs[p])
                 del kwargs[p]
@@ -658,6 +660,11 @@
     command = None # set this to a command, or set in kwargs
     progressMetrics = ['output']
 
+    parms = BuildStep.parms + [
+        'description',
+        'descriptionDone',
+        ]
+
     def __init__(self, **kwargs):
         # most of our arguments get passed through to the RemoteShellCommand
         # that we create, but first strip out the ones that we pass to
@@ -665,7 +672,7 @@
         self.workdir = kwargs['workdir'] # required by RemoteShellCommand
         buildstep_kwargs = {}
         for k in kwargs.keys()[:]:
-            if k in BuildStep.parms:
+            if k in self.__class__.parms:
                 buildstep_kwargs[k] = kwargs[k]
                 del kwargs[k]
         BuildStep.__init__(self, **buildstep_kwargs)
@@ -988,15 +995,21 @@
                      }
         self.alwaysUseLatest = alwaysUseLatest
 
-        self.description = ["updating"]
-        self.descriptionDone = ["update"]
+        # Compute defaults for descriptions:
+        description = ["updating"]
+        descriptionDone = ["update"]
         if mode == "clobber":
-            self.description = ["checkout"]
+            description = ["checkout"]
             # because checkingouting takes too much space
-            self.descriptionDone = ["checkout"]
+            descriptionDone = ["checkout"]
         elif mode == "export":
-            self.description = ["exporting"]
-            self.descriptionDone = ["export"]
+            description = ["exporting"]
+            descriptionDone = ["export"]
+        # Initialize descriptions if not already set:
+        if self.description is None:
+            self.description = description
+        if self.descriptionDone is None:
+            self.descriptionDone = descriptionDone
 
     def computeSourceRevision(self, changes):
         """Each subclass must implement this method to do something more





More information about the Commits mailing list