[Buildbot-commits] buildbot/buildbot/steps transfer.py,1.3,1.4
Brian Warner
warner at users.sourceforge.net
Fri Oct 13 07:30:03 UTC 2006
Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6047/buildbot/steps
Modified Files:
transfer.py
Log Message:
[project @ filetransfer: code cleanups]
Original author: warner at lothar.com
Date: 2006-10-13 07:28:48
Index: transfer.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/transfer.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- transfer.py 17 Sep 2006 20:35:49 -0000 1.3
+++ transfer.py 13 Oct 2006 07:29:58 -0000 1.4
@@ -104,20 +104,20 @@
name = 'upload'
- def __init__(self, build, **kwargs):
- buildstep_kwargs = {}
- for k in kwargs.keys()[:]:
- if k in BuildStep.parms:
- buildstep_kwargs[k] = kwargs[k]
- del kwargs[k]
- BuildStep.__init__(self, build, **buildstep_kwargs)
+ def __init__(self, build, slavesrc, masterdest,
+ workdir="build", maxsize=None, blocksize=16*1024,
+ **buildstep_kwargs):
+ BuildStep.__init__(self, build, **buildstep_kwargs)
- self.args = kwargs
- self.fileWriter = None
+ self.slavesrc = slavesrc
+ self.masterdest = masterdest
+ self.workdir = workdir
+ self.maxsize = maxsize
+ self.blocksize = blocksize
def start(self):
- source = self.args['slavesrc']
- masterdest = self.args['masterdest']
+ source = self.slavesrc
+ masterdest = self.masterdest
# we rely upon the fact that the buildmaster runs chdir'ed into its
# basedir to make sure that relative paths in masterdest are expanded
# properly. TODO: maybe pass the master's basedir all the way down
@@ -134,12 +134,12 @@
# default arguments
args = {
- 'maxsize': None,
- 'blocksize': 16*1024,
- 'workdir': 'build',
+ 'slavesrc': source,
+ 'workdir': self.workdir,
+ 'writer': self.fileWriter,
+ 'maxsize': self.maxsize,
+ 'blocksize': self.blocksize
}
- args.update(self.args)
- args['writer'] = self.fileWriter
self.cmd = StatusRemoteCommand('uploadFile', args)
d = self.runCommand(self.cmd)
@@ -173,20 +173,20 @@
name = 'download'
- def __init__(self,build, **kwargs):
- buildstep_kwargs = {}
- for k in kwargs.keys()[:]:
- if k in BuildStep.parms:
- buildstep_kwargs[k] = kwargs[k]
- del kwargs[k]
- BuildStep.__init__(self, build, **buildstep_kwargs)
+ def __init__(self, build, mastersrc, slavedest,
+ workdir="build", maxsize=None, blocksize=16*1024,
+ **buildstep_kwargs):
+ BuildStep.__init__(self, build, **buildstep_kwargs)
- self.args = kwargs
- self.fileReader = None
+ self.mastersrc = mastersrc
+ self.slavedest = slavedest
+ self.workdir = workdir
+ self.maxsize = maxsize
+ self.blocksize = blocksize
def start(self):
- source = os.path.expanduser(self.args['mastersrc'])
- slavedest = self.args['slavedest']
+ source = os.path.expanduser(self.mastersrc)
+ slavedest = self.slavedest
log.msg("FileDownload started, from master %r to slave %r" %
(source, slavedest))
@@ -206,12 +206,12 @@
# default arguments
args = {
- 'maxsize': None,
- 'blocksize': 16*1024,
- 'workdir': 'build',
+ 'slavedest': self.slavedest,
+ 'maxsize': self.maxsize,
+ 'reader': self.fileReader,
+ 'blocksize': self.blocksize,
+ 'workdir': self.workdir,
}
- args.update(self.args)
- args['reader'] = self.fileReader
self.cmd = StatusRemoteCommand('downloadFile', args)
d = self.runCommand(self.cmd)
More information about the Commits
mailing list