comparison bitten/slave.py @ 411:a169d2e96463

Use reStructuredText as the API documentation syntax.
author cmlenz
date Tue, 07 Aug 2007 11:29:11 +0000
parents 933105ab516b
children aa34d82b2c9a
comparison
equal deleted inserted replaced
410:7930cdd83d13 411:a169d2e96463
27 from bitten.build import BuildError 27 from bitten.build import BuildError
28 from bitten.build.config import Configuration 28 from bitten.build.config import Configuration
29 from bitten.recipe import Recipe, InvalidRecipeError 29 from bitten.recipe import Recipe, InvalidRecipeError
30 from bitten.util import xmlio 30 from bitten.util import xmlio
31 31
32 __all__ = ['BuildSlave', 'ExitSlave']
33 __docformat__ = 'restructuredtext en'
34
32 log = logging.getLogger('bitten.slave') 35 log = logging.getLogger('bitten.slave')
33 36
34 37
35 class SaneHTTPErrorProcessor(urllib2.HTTPErrorProcessor): 38 class SaneHTTPErrorProcessor(urllib2.HTTPErrorProcessor):
36 "The HTTPErrorProcessor defined in urllib needs some love." 39 "The HTTPErrorProcessor defined in urllib needs some love."
49 def __init__(self, url, name=None, config=None, dry_run=False, 52 def __init__(self, url, name=None, config=None, dry_run=False,
50 work_dir=None, keep_files=False, single_build=False, 53 work_dir=None, keep_files=False, single_build=False,
51 username=None, password=None): 54 username=None, password=None):
52 """Create the build slave instance. 55 """Create the build slave instance.
53 56
54 @param url: The URL of the build master 57 :param url: The URL of the build master
55 @param port: TCP port number of the build master to connect to 58 :param name: The name with which this slave should identify itself
56 @param name: The name with which this slave should identify itself 59 :param config: The slave configuration
57 @param config: The slave configuration 60 :param dry_run: Whether the build outcome should not be reported back
58 @param dry_run: Whether the build outcome should not be reported back 61 to the master
59 to the master 62 :param work_dir: The working directory to use for build execution
60 @param work_dir: The working directory to use for build execution 63 :param keep_files: Whether files and directories created for build
61 @param keep_files: Whether files and directories created for build 64 execution should be kept when done
62 execution should be kept when done 65 :param single_build: Whether this slave should exit after completing a
63 @param single_build: Whether this slave should exit after completing a 66 single build, or continue processing builds forever
64 single build, or continue processing builds forever 67 :param username: the username to use when authentication against the
65 @param username: the username to use when authentication against the 68 build master is requested
66 build master is requested 69 :param password: the password to use when authentication is needed
67 @param password: the password to use when authentication is needed
68 """ 70 """
69 self.url = url 71 self.url = url
70 if name is None: 72 if name is None:
71 name = platform.node().split('.', 1)[0].lower() 73 name = platform.node().split('.', 1)[0].lower()
72 self.name = name 74 self.name = name
212 return not failed or step.onerror != 'fail' 214 return not failed or step.onerror != 'fail'
213 215
214 216
215 class ExitSlave(Exception): 217 class ExitSlave(Exception):
216 """Exception used internally by the slave to signal that the slave process 218 """Exception used internally by the slave to signal that the slave process
217 should be stopped.""" 219 should be stopped.
220 """
218 221
219 222
220 def main(): 223 def main():
221 """Main entry point for running the build slave.""" 224 """Main entry point for running the build slave."""
222 from bitten import __version__ as VERSION 225 from bitten import __version__ as VERSION
Copyright (C) 2012-2017 Edgewall Software