[Buildbot-commits] buildbot/buildbot/process step.py,1.105,1.106

Brian Warner warner at users.sourceforge.net
Fri Sep 15 14:49:14 UTC 2006


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

Modified Files:
	step.py 
Log Message:
[project @ filetransfer: some stylistic changes]

Original author: warner at lothar.com
Date: 2006-09-08 21:44:26

Index: step.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- step.py	15 Sep 2006 14:49:06 -0000	1.105
+++ step.py	15 Sep 2006 14:49:12 -0000	1.106
@@ -1149,21 +1149,22 @@
 
 class FileUpload(BuildStep):
     """
-    Build step to upload a file
+    Build step to transfer a file from the slave to the master.
+
     arguments:
 
-    ['slavesrc']   filename of source file at slave
-    ['masterdest'] filename of destination file at master
-    ['workdir']    string with slave working directory relative to builder
-                   base dir, default 'build'
-    ['maxsize']    maximum size of the file, default None (=unlimited)
-    ['blocksize']  maximum size of each block being transfered
+    - ['slavesrc']   filename of source file at slave, relative to workdir
+    - ['masterdest'] filename of destination file at master
+    - ['workdir']    string with slave working directory relative to builder
+                     base dir, default 'build'
+    - ['maxsize']    maximum size of the file, default None (=unlimited)
+    - ['blocksize']  maximum size of each block being transfered
 
     """
 
     name = 'upload'
 
-    def __init__(self,build, **kwargs):
+    def __init__(self, build, **kwargs):
         buildstep_kwargs = {}
         for k in kwargs.keys()[:]:
             if k in BuildStep.parms:
@@ -1184,15 +1185,16 @@
         fp = open(self.args['masterdest'],'w')
         self.fileWriter = FileWriter(fp)
 
-        a = self.args.copy()
-        a['writer'] = self.fileWriter
-
-        # add defaults for optional settings
-        for k,dv in [('maxsize',None),('blocksize',16*1024),('workdir','build')]:
-            if k not in a:
-                a[k] = dv
+        # default arguments
+        args = {
+            'maxsize': None,
+            'blocksize': 16*1024,
+            'workdir': 'build',
+            }
+        args.update(self.args)
+        args['writer'] = self.fileWriter
 
-        self.cmd = StatusRemoteCommand('uploadFile', a)
+        self.cmd = StatusRemoteCommand('uploadFile', args)
         d = self.runCommand(self.cmd)
         d.addCallback(self.finished).addErrback(self.failed)
 





More information about the Commits mailing list