partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
startWorker
Start worker process. Fork and start twisted application described in basedir buildbot.tac file. Print it's log messages to stdout for a while and try to figure out if start was successful. If quiet or nodaemon parameters are True, or we are running on a win32 system, will not fork and log will no...
worker/buildbot_worker/scripts/start.py
def startWorker(basedir, quiet, nodaemon): """ Start worker process. Fork and start twisted application described in basedir buildbot.tac file. Print it's log messages to stdout for a while and try to figure out if start was successful. If quiet or nodaemon parameters are True, or we are runni...
def startWorker(basedir, quiet, nodaemon): """ Start worker process. Fork and start twisted application described in basedir buildbot.tac file. Print it's log messages to stdout for a while and try to figure out if start was successful. If quiet or nodaemon parameters are True, or we are runni...
[ "Start", "worker", "process", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/start.py#L83-L119
[ "def", "startWorker", "(", "basedir", ",", "quiet", ",", "nodaemon", ")", ":", "os", ".", "chdir", "(", "basedir", ")", "if", "quiet", "or", "nodaemon", ":", "return", "launch", "(", "nodaemon", ")", "# we probably can't do this os.fork under windows", "from", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Api.textwidth
Calculates the width of the specified text.
www/badges/buildbot_badges/__init__.py
def textwidth(self, text, config): """Calculates the width of the specified text. """ surface = cairo.SVGSurface(None, 1280, 200) ctx = cairo.Context(surface) ctx.select_font_face(config['font_face'], cairo.FONT_SLANT_NORMAL, ...
def textwidth(self, text, config): """Calculates the width of the specified text. """ surface = cairo.SVGSurface(None, 1280, 200) ctx = cairo.Context(surface) ctx.select_font_face(config['font_face'], cairo.FONT_SLANT_NORMAL, ...
[ "Calculates", "the", "width", "of", "the", "specified", "text", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/www/badges/buildbot_badges/__init__.py#L109-L118
[ "def", "textwidth", "(", "self", ",", "text", ",", "config", ")", ":", "surface", "=", "cairo", ".", "SVGSurface", "(", "None", ",", "1280", ",", "200", ")", "ctx", "=", "cairo", ".", "Context", "(", "surface", ")", "ctx", ".", "select_font_face", "(...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Api.makesvg
Renders an SVG from the template, using the specified data
www/badges/buildbot_badges/__init__.py
def makesvg(self, right_text, status=None, left_text=None, left_color=None, config=None): """Renders an SVG from the template, using the specified data """ right_color = config['color_scheme'].get(status, "#9f9f9f") # Grey left_text = left_text or config['left_text'] ...
def makesvg(self, right_text, status=None, left_text=None, left_color=None, config=None): """Renders an SVG from the template, using the specified data """ right_color = config['color_scheme'].get(status, "#9f9f9f") # Grey left_text = left_text or config['left_text'] ...
[ "Renders", "an", "SVG", "from", "the", "template", "using", "the", "specified", "data" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/www/badges/buildbot_badges/__init__.py#L120-L141
[ "def", "makesvg", "(", "self", ",", "right_text", ",", "status", "=", "None", ",", "left_text", "=", "None", ",", "left_color", "=", "None", ",", "config", "=", "None", ")", ":", "right_color", "=", "config", "[", "'color_scheme'", "]", ".", "get", "("...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CommandlineUserManagerPerspective.formatResults
This formats the results of the database operations for printing back to the caller @param op: operation to perform (add, remove, update, get) @type op: string @param results: results from db queries in perspective_commandline @type results: list @returns: string conta...
master/buildbot/process/users/manual.py
def formatResults(self, op, results): """ This formats the results of the database operations for printing back to the caller @param op: operation to perform (add, remove, update, get) @type op: string @param results: results from db queries in perspective_commandline ...
def formatResults(self, op, results): """ This formats the results of the database operations for printing back to the caller @param op: operation to perform (add, remove, update, get) @type op: string @param results: results from db queries in perspective_commandline ...
[ "This", "formats", "the", "results", "of", "the", "database", "operations", "for", "printing", "back", "to", "the", "caller" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/users/manual.py#L37-L83
[ "def", "formatResults", "(", "self", ",", "op", ",", "results", ")", ":", "formatted_results", "=", "\"\"", "if", "op", "==", "'add'", ":", "# list, alternating ident, uid", "formatted_results", "+=", "\"user(s) added:\\n\"", "for", "user", "in", "results", ":", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CommandlineUserManagerPerspective.perspective_commandline
This performs the requested operations from the `buildbot user` call by calling the proper buildbot.db.users methods based on the operation. It yields a deferred instance with the results from the database methods. @param op: operation to perform (add, remove, update, get) @type...
master/buildbot/process/users/manual.py
def perspective_commandline(self, op, bb_username, bb_password, ids, info): """ This performs the requested operations from the `buildbot user` call by calling the proper buildbot.db.users methods based on the operation. It yields a deferred instance with the results from the dat...
def perspective_commandline(self, op, bb_username, bb_password, ids, info): """ This performs the requested operations from the `buildbot user` call by calling the proper buildbot.db.users methods based on the operation. It yields a deferred instance with the results from the dat...
[ "This", "performs", "the", "requested", "operations", "from", "the", "buildbot", "user", "call", "by", "calling", "the", "proper", "buildbot", ".", "db", ".", "users", "methods", "based", "on", "the", "operation", ".", "It", "yields", "a", "deferred", "insta...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/users/manual.py#L86-L187
[ "def", "perspective_commandline", "(", "self", ",", "op", ",", "bb_username", ",", "bb_password", ",", "ids", ",", "info", ")", ":", "log", ".", "msg", "(", "\"perspective_commandline called\"", ")", "results", "=", "[", "]", "# pylint: disable=too-many-nested-blo...
5df3cfae6d760557d99156633c32b1822a1e130c
train
StatsService.yieldMetricsValue
A method to allow posting data that is not generated and stored as build-data in the database. This method generates the `stats-yield-data` event to the mq layer which is then consumed in self.postData. @params data_name: (str) The unique name for identifying this data. post_dat...
master/buildbot/statistics/stats_service.py
def yieldMetricsValue(self, data_name, post_data, buildid): """ A method to allow posting data that is not generated and stored as build-data in the database. This method generates the `stats-yield-data` event to the mq layer which is then consumed in self.postData. @params ...
def yieldMetricsValue(self, data_name, post_data, buildid): """ A method to allow posting data that is not generated and stored as build-data in the database. This method generates the `stats-yield-data` event to the mq layer which is then consumed in self.postData. @params ...
[ "A", "method", "to", "allow", "posting", "data", "that", "is", "not", "generated", "and", "stored", "as", "build", "-", "data", "in", "the", "database", ".", "This", "method", "generates", "the", "stats", "-", "yield", "-", "data", "event", "to", "the", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/statistics/stats_service.py#L73-L93
[ "def", "yieldMetricsValue", "(", "self", ",", "data_name", ",", "post_data", ",", "buildid", ")", ":", "build_data", "=", "yield", "self", ".", "master", ".", "data", ".", "get", "(", "(", "'builds'", ",", "buildid", ")", ")", "routingKey", "=", "(", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
get_plugins
helper to get a direct interface to _Plugins
master/buildbot/plugins/db.py
def get_plugins(namespace, interface=None, check_extras=True, load_now=False): """ helper to get a direct interface to _Plugins """ return _DB.add_namespace(namespace, interface, check_extras, load_now)
def get_plugins(namespace, interface=None, check_extras=True, load_now=False): """ helper to get a direct interface to _Plugins """ return _DB.add_namespace(namespace, interface, check_extras, load_now)
[ "helper", "to", "get", "a", "direct", "interface", "to", "_Plugins" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/plugins/db.py#L347-L351
[ "def", "get_plugins", "(", "namespace", ",", "interface", "=", "None", ",", "check_extras", "=", "True", ",", "load_now", "=", "False", ")", ":", "return", "_DB", ".", "add_namespace", "(", "namespace", ",", "interface", ",", "check_extras", ",", "load_now",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_PluginDB.add_namespace
register given namespace in global database of plugins in case it's already registered, return the registration
master/buildbot/plugins/db.py
def add_namespace(self, namespace, interface=None, check_extras=True, load_now=False): """ register given namespace in global database of plugins in case it's already registered, return the registration """ tempo = self._namespaces.get(namespace) i...
def add_namespace(self, namespace, interface=None, check_extras=True, load_now=False): """ register given namespace in global database of plugins in case it's already registered, return the registration """ tempo = self._namespaces.get(namespace) i...
[ "register", "given", "namespace", "in", "global", "database", "of", "plugins" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/plugins/db.py#L287-L303
[ "def", "add_namespace", "(", "self", ",", "namespace", ",", "interface", "=", "None", ",", "check_extras", "=", "True", ",", "load_now", "=", "False", ")", ":", "tempo", "=", "self", ".", "_namespaces", ".", "get", "(", "namespace", ")", "if", "tempo", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_PluginDB.info
get information about all plugins in registered namespaces
master/buildbot/plugins/db.py
def info(self): """ get information about all plugins in registered namespaces """ result = dict() for name, namespace in self._namespaces.items(): result[name] = namespace.info_all() return result
def info(self): """ get information about all plugins in registered namespaces """ result = dict() for name, namespace in self._namespaces.items(): result[name] = namespace.info_all() return result
[ "get", "information", "about", "all", "plugins", "in", "registered", "namespaces" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/plugins/db.py#L312-L319
[ "def", "info", "(", "self", ")", ":", "result", "=", "dict", "(", ")", "for", "name", ",", "namespace", "in", "self", ".", "_namespaces", ".", "items", "(", ")", ":", "result", "[", "name", "]", "=", "namespace", ".", "info_all", "(", ")", "return"...
5df3cfae6d760557d99156633c32b1822a1e130c
train
PBManager.register
Register a perspective factory PFACTORY to be executed when a PB connection arrives on PORTSTR with USERNAME/PASSWORD. Returns a Registration object which can be used to unregister later.
master/buildbot/pbmanager.py
def register(self, portstr, username, password, pfactory): """ Register a perspective factory PFACTORY to be executed when a PB connection arrives on PORTSTR with USERNAME/PASSWORD. Returns a Registration object which can be used to unregister later. """ # do some basic ...
def register(self, portstr, username, password, pfactory): """ Register a perspective factory PFACTORY to be executed when a PB connection arrives on PORTSTR with USERNAME/PASSWORD. Returns a Registration object which can be used to unregister later. """ # do some basic ...
[ "Register", "a", "perspective", "factory", "PFACTORY", "to", "be", "executed", "when", "a", "PB", "connection", "arrives", "on", "PORTSTR", "with", "USERNAME", "/", "PASSWORD", ".", "Returns", "a", "Registration", "object", "which", "can", "be", "used", "to", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/pbmanager.py#L50-L70
[ "def", "register", "(", "self", ",", "portstr", ",", "username", ",", "password", ",", "pfactory", ")", ":", "# do some basic normalization of portstrs", "if", "isinstance", "(", "portstr", ",", "type", "(", "0", ")", ")", "or", "':'", "not", "in", "portstr"...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Registration.getPort
Helper method for testing; returns the TCP port used for this registration, even if it was specified as 0 and thus allocated by the OS.
master/buildbot/pbmanager.py
def getPort(self): """ Helper method for testing; returns the TCP port used for this registration, even if it was specified as 0 and thus allocated by the OS. """ disp = self.pbmanager.dispatchers[self.portstr] return disp.port.getHost().port
def getPort(self): """ Helper method for testing; returns the TCP port used for this registration, even if it was specified as 0 and thus allocated by the OS. """ disp = self.pbmanager.dispatchers[self.portstr] return disp.port.getHost().port
[ "Helper", "method", "for", "testing", ";", "returns", "the", "TCP", "port", "used", "for", "this", "registration", "even", "if", "it", "was", "specified", "as", "0", "and", "thus", "allocated", "by", "the", "OS", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/pbmanager.py#L104-L111
[ "def", "getPort", "(", "self", ")", ":", "disp", "=", "self", ".", "pbmanager", ".", "dispatchers", "[", "self", ".", "portstr", "]", "return", "disp", ".", "port", ".", "getHost", "(", ")", ".", "port" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
Worker.gracefulShutdown
Start shutting down
worker/buildbot_worker/pb.py
def gracefulShutdown(self): """Start shutting down""" if not self.bf.perspective: log.msg("No active connection, shutting down NOW") reactor.stop() return log.msg( "Telling the master we want to shutdown after any running builds are finished") ...
def gracefulShutdown(self): """Start shutting down""" if not self.bf.perspective: log.msg("No active connection, shutting down NOW") reactor.stop() return log.msg( "Telling the master we want to shutdown after any running builds are finished") ...
[ "Start", "shutting", "down" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/pb.py#L229-L249
[ "def", "gracefulShutdown", "(", "self", ")", ":", "if", "not", "self", ".", "bf", ".", "perspective", ":", "log", ".", "msg", "(", "\"No active connection, shutting down NOW\"", ")", "reactor", ".", "stop", "(", ")", "return", "log", ".", "msg", "(", "\"Te...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HangCheckProtocol._startHungConnectionTimer
Start a timer to detect if the connection is hung.
worker/buildbot_worker/util/_hangcheck.py
def _startHungConnectionTimer(self): """ Start a timer to detect if the connection is hung. """ def hungConnection(): self._hung_callback() self._hungConnectionTimer = None self.transport.loseConnection() self._hungConnectionTimer = self._react...
def _startHungConnectionTimer(self): """ Start a timer to detect if the connection is hung. """ def hungConnection(): self._hung_callback() self._hungConnectionTimer = None self.transport.loseConnection() self._hungConnectionTimer = self._react...
[ "Start", "a", "timer", "to", "detect", "if", "the", "connection", "is", "hung", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/util/_hangcheck.py#L66-L75
[ "def", "_startHungConnectionTimer", "(", "self", ")", ":", "def", "hungConnection", "(", ")", ":", "self", ".", "_hung_callback", "(", ")", "self", ".", "_hungConnectionTimer", "=", "None", "self", ".", "transport", ".", "loseConnection", "(", ")", "self", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BaseLock.isAvailable
Return a boolean whether the lock is available for claiming
master/buildbot/locks.py
def isAvailable(self, requester, access): """ Return a boolean whether the lock is available for claiming """ debuglog("%s isAvailable(%s, %s): self.owners=%r" % (self, requester, access, self.owners)) num_excl, num_counting = self._claimed_excl, self._claimed_counting ...
def isAvailable(self, requester, access): """ Return a boolean whether the lock is available for claiming """ debuglog("%s isAvailable(%s, %s): self.owners=%r" % (self, requester, access, self.owners)) num_excl, num_counting = self._claimed_excl, self._claimed_counting ...
[ "Return", "a", "boolean", "whether", "the", "lock", "is", "available", "for", "claiming" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/locks.py#L76-L96
[ "def", "isAvailable", "(", "self", ",", "requester", ",", "access", ")", ":", "debuglog", "(", "\"%s isAvailable(%s, %s): self.owners=%r\"", "%", "(", "self", ",", "requester", ",", "access", ",", "self", ".", "owners", ")", ")", "num_excl", ",", "num_counting...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BaseLock.claim
Claim the lock (lock must be available)
master/buildbot/locks.py
def claim(self, owner, access): """ Claim the lock (lock must be available) """ debuglog("%s claim(%s, %s)" % (self, owner, access.mode)) assert owner is not None assert self.isAvailable(owner, access), "ask for isAvailable() first" assert isinstance(access, LockAccess) ...
def claim(self, owner, access): """ Claim the lock (lock must be available) """ debuglog("%s claim(%s, %s)" % (self, owner, access.mode)) assert owner is not None assert self.isAvailable(owner, access), "ask for isAvailable() first" assert isinstance(access, LockAccess) ...
[ "Claim", "the", "lock", "(", "lock", "must", "be", "available", ")" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/locks.py#L122-L133
[ "def", "claim", "(", "self", ",", "owner", ",", "access", ")", ":", "debuglog", "(", "\"%s claim(%s, %s)\"", "%", "(", "self", ",", "owner", ",", "access", ".", "mode", ")", ")", "assert", "owner", "is", "not", "None", "assert", "self", ".", "isAvailab...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BaseLock.release
Release the lock
master/buildbot/locks.py
def release(self, owner, access): """ Release the lock """ assert isinstance(access, LockAccess) debuglog("%s release(%s, %s)" % (self, owner, access.mode)) if not self._removeOwner(owner, access): debuglog("%s already released" % self) return self._tryW...
def release(self, owner, access): """ Release the lock """ assert isinstance(access, LockAccess) debuglog("%s release(%s, %s)" % (self, owner, access.mode)) if not self._removeOwner(owner, access): debuglog("%s already released" % self) return self._tryW...
[ "Release", "the", "lock" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/locks.py#L140-L152
[ "def", "release", "(", "self", ",", "owner", ",", "access", ")", ":", "assert", "isinstance", "(", "access", ",", "LockAccess", ")", "debuglog", "(", "\"%s release(%s, %s)\"", "%", "(", "self", ",", "owner", ",", "access", ".", "mode", ")", ")", "if", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BaseLock.waitUntilMaybeAvailable
Fire when the lock *might* be available. The caller will need to check with isAvailable() when the deferred fires. This loose form is used to avoid deadlocks. If we were interested in a stronger form, this would be named 'waitUntilAvailable', and the deferred would fire after the lock ha...
master/buildbot/locks.py
def waitUntilMaybeAvailable(self, owner, access): """Fire when the lock *might* be available. The caller will need to check with isAvailable() when the deferred fires. This loose form is used to avoid deadlocks. If we were interested in a stronger form, this would be named 'waitUntilAvai...
def waitUntilMaybeAvailable(self, owner, access): """Fire when the lock *might* be available. The caller will need to check with isAvailable() when the deferred fires. This loose form is used to avoid deadlocks. If we were interested in a stronger form, this would be named 'waitUntilAvai...
[ "Fire", "when", "the", "lock", "*", "might", "*", "be", "available", ".", "The", "caller", "will", "need", "to", "check", "with", "isAvailable", "()", "when", "the", "deferred", "fires", ".", "This", "loose", "form", "is", "used", "to", "avoid", "deadloc...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/locks.py#L178-L197
[ "def", "waitUntilMaybeAvailable", "(", "self", ",", "owner", ",", "access", ")", ":", "debuglog", "(", "\"%s waitUntilAvailable(%s)\"", "%", "(", "self", ",", "owner", ")", ")", "assert", "isinstance", "(", "access", ",", "LockAccess", ")", "if", "self", "."...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CacheManager.get_cache
Get an L{AsyncLRUCache} object with the given name. If such an object does not exist, it will be created. Since the cache is permanent, this method can be called only once, e.g., in C{startService}, and it value stored indefinitely. @param cache_name: name of the cache (usually the na...
master/buildbot/process/cache.py
def get_cache(self, cache_name, miss_fn): """ Get an L{AsyncLRUCache} object with the given name. If such an object does not exist, it will be created. Since the cache is permanent, this method can be called only once, e.g., in C{startService}, and it value stored indefinitely....
def get_cache(self, cache_name, miss_fn): """ Get an L{AsyncLRUCache} object with the given name. If such an object does not exist, it will be created. Since the cache is permanent, this method can be called only once, e.g., in C{startService}, and it value stored indefinitely....
[ "Get", "an", "L", "{", "AsyncLRUCache", "}", "object", "with", "the", "given", "name", ".", "If", "such", "an", "object", "does", "not", "exist", "it", "will", "be", "created", ".", "Since", "the", "cache", "is", "permanent", "this", "method", "can", "...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/cache.py#L40-L59
[ "def", "get_cache", "(", "self", ",", "cache_name", ",", "miss_fn", ")", ":", "try", ":", "return", "self", ".", "_caches", "[", "cache_name", "]", "except", "KeyError", ":", "max_size", "=", "self", ".", "config", ".", "get", "(", "cache_name", ",", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
ChangeHookResource.render_POST
Responds to events and starts the build process different implementations can decide on what methods they will accept :arguments: request the http request object
master/buildbot/www/change_hook.py
def render_POST(self, request): """ Responds to events and starts the build process different implementations can decide on what methods they will accept :arguments: request the http request object """ try: d = self.getAndSubmitC...
def render_POST(self, request): """ Responds to events and starts the build process different implementations can decide on what methods they will accept :arguments: request the http request object """ try: d = self.getAndSubmitC...
[ "Responds", "to", "events", "and", "starts", "the", "build", "process", "different", "implementations", "can", "decide", "on", "what", "methods", "they", "will", "accept" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/change_hook.py#L70-L102
[ "def", "render_POST", "(", "self", ",", "request", ")", ":", "try", ":", "d", "=", "self", ".", "getAndSubmitChanges", "(", "request", ")", "except", "Exception", ":", "d", "=", "defer", ".", "fail", "(", ")", "def", "ok", "(", "_", ")", ":", "requ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
ChangeHookResource.makeHandler
create and cache the handler object for this dialect
master/buildbot/www/change_hook.py
def makeHandler(self, dialect): """create and cache the handler object for this dialect""" if dialect not in self.dialects: m = "The dialect specified, '{}', wasn't whitelisted in change_hook".format(dialect) log.msg(m) log.msg( "Note: if dialect is 'b...
def makeHandler(self, dialect): """create and cache the handler object for this dialect""" if dialect not in self.dialects: m = "The dialect specified, '{}', wasn't whitelisted in change_hook".format(dialect) log.msg(m) log.msg( "Note: if dialect is 'b...
[ "create", "and", "cache", "the", "handler", "object", "for", "this", "dialect" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/change_hook.py#L113-L134
[ "def", "makeHandler", "(", "self", ",", "dialect", ")", ":", "if", "dialect", "not", "in", "self", ".", "dialects", ":", "m", "=", "\"The dialect specified, '{}', wasn't whitelisted in change_hook\"", ".", "format", "(", "dialect", ")", "log", ".", "msg", "(", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
ChangeHookResource.getChanges
Take the logic from the change hook, and then delegate it to the proper handler We use the buildbot plugin mechanisms to find out about dialects and call getChanges() the return value is a list of changes if DIALECT is unspecified, a sample implementation is provided
master/buildbot/www/change_hook.py
def getChanges(self, request): """ Take the logic from the change hook, and then delegate it to the proper handler We use the buildbot plugin mechanisms to find out about dialects and call getChanges() the return value is a list of changes if DIALECT is unspec...
def getChanges(self, request): """ Take the logic from the change hook, and then delegate it to the proper handler We use the buildbot plugin mechanisms to find out about dialects and call getChanges() the return value is a list of changes if DIALECT is unspec...
[ "Take", "the", "logic", "from", "the", "change", "hook", "and", "then", "delegate", "it", "to", "the", "proper", "handler" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/change_hook.py#L137-L168
[ "def", "getChanges", "(", "self", ",", "request", ")", ":", "uriRE", "=", "re", ".", "search", "(", "r'^/change_hook/?([a-zA-Z0-9_]*)'", ",", "bytes2unicode", "(", "request", ".", "uri", ")", ")", "if", "not", "uriRE", ":", "log", ".", "msg", "(", "\"URI...
5df3cfae6d760557d99156633c32b1822a1e130c
train
decode
We need to convert a dictionary where keys and values are bytes, to unicode strings. This happens when a Python 2 worker sends a dictionary back to a Python 3 master.
master/buildbot/pbutil.py
def decode(data, encoding='utf-8', errors='strict'): """We need to convert a dictionary where keys and values are bytes, to unicode strings. This happens when a Python 2 worker sends a dictionary back to a Python 3 master. """ data_type = type(data) if data_type == bytes: return bytes2...
def decode(data, encoding='utf-8', errors='strict'): """We need to convert a dictionary where keys and values are bytes, to unicode strings. This happens when a Python 2 worker sends a dictionary back to a Python 3 master. """ data_type = type(data) if data_type == bytes: return bytes2...
[ "We", "need", "to", "convert", "a", "dictionary", "where", "keys", "and", "values", "are", "bytes", "to", "unicode", "strings", ".", "This", "happens", "when", "a", "Python", "2", "worker", "sends", "a", "dictionary", "back", "to", "a", "Python", "3", "m...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/pbutil.py#L157-L170
[ "def", "decode", "(", "data", ",", "encoding", "=", "'utf-8'", ",", "errors", "=", "'strict'", ")", ":", "data_type", "=", "type", "(", "data", ")", "if", "data_type", "==", "bytes", ":", "return", "bytes2unicode", "(", "data", ",", "encoding", ",", "e...
5df3cfae6d760557d99156633c32b1822a1e130c
train
ReconnectingPBClientFactory.failedToGetPerspective
The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials.
master/buildbot/pbutil.py
def failedToGetPerspective(self, why): """The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials. """ log.msg("ReconnectingPBClientFactory.failedTo...
def failedToGetPerspective(self, why): """The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials. """ log.msg("ReconnectingPBClientFactory.failedTo...
[ "The", "login", "process", "failed", "most", "likely", "because", "of", "an", "authorization", "failure", "(", "bad", "password", ")", "but", "it", "is", "also", "possible", "that", "we", "lost", "the", "new", "connection", "before", "we", "managed", "to", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/pbutil.py#L142-L154
[ "def", "failedToGetPerspective", "(", "self", ",", "why", ")", ":", "log", ".", "msg", "(", "\"ReconnectingPBClientFactory.failedToGetPerspective\"", ")", "if", "why", ".", "check", "(", "pb", ".", "PBConnectionLost", ")", ":", "log", ".", "msg", "(", "\"we lo...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CreateWorkerOptions.validateMasterArgument
Parse the <master> argument. @param master_arg: the <master> argument to parse @return: tuple of master's host and port @raise UsageError: on errors parsing the argument
worker/buildbot_worker/scripts/runner.py
def validateMasterArgument(self, master_arg): """ Parse the <master> argument. @param master_arg: the <master> argument to parse @return: tuple of master's host and port @raise UsageError: on errors parsing the argument """ if master_arg[:5] == "http:": ...
def validateMasterArgument(self, master_arg): """ Parse the <master> argument. @param master_arg: the <master> argument to parse @return: tuple of master's host and port @raise UsageError: on errors parsing the argument """ if master_arg[:5] == "http:": ...
[ "Parse", "the", "<master", ">", "argument", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/runner.py#L145-L172
[ "def", "validateMasterArgument", "(", "self", ",", "master_arg", ")", ":", "if", "master_arg", "[", ":", "5", "]", "==", "\"http:\"", ":", "raise", "usage", ".", "UsageError", "(", "\"<master> is not a URL - do not use URL\"", ")", "if", "\":\"", "not", "in", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildsConnectorComponent.setBuildProperty
A kind of create_or_update, that's between one or two queries per call
master/buildbot/db/builds.py
def setBuildProperty(self, bid, name, value, source): """ A kind of create_or_update, that's between one or two queries per call """ def thd(conn): bp_tbl = self.db.model.build_properties self.checkLength(bp_tbl.c.name, name) self.checkLength(bp_tbl.c.source, ...
def setBuildProperty(self, bid, name, value, source): """ A kind of create_or_update, that's between one or two queries per call """ def thd(conn): bp_tbl = self.db.model.build_properties self.checkLength(bp_tbl.c.name, name) self.checkLength(bp_tbl.c.source, ...
[ "A", "kind", "of", "create_or_update", "that", "s", "between", "one", "or", "two", "queries", "per", "call" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/db/builds.py#L192-L213
[ "def", "setBuildProperty", "(", "self", ",", "bid", ",", "name", ",", "value", ",", "source", ")", ":", "def", "thd", "(", "conn", ")", ":", "bp_tbl", "=", "self", ".", "db", ".", "model", ".", "build_properties", "self", ".", "checkLength", "(", "bp...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Log._decoderFromString
Return a decoder function. If cfg is a string such as 'latin-1' or u'latin-1', then we return a new lambda, s.decode(). If cfg is already a lambda or function, then we return that.
master/buildbot/process/log.py
def _decoderFromString(cfg): """ Return a decoder function. If cfg is a string such as 'latin-1' or u'latin-1', then we return a new lambda, s.decode(). If cfg is already a lambda or function, then we return that. """ if isinstance(cfg, (bytes, str)): ...
def _decoderFromString(cfg): """ Return a decoder function. If cfg is a string such as 'latin-1' or u'latin-1', then we return a new lambda, s.decode(). If cfg is already a lambda or function, then we return that. """ if isinstance(cfg, (bytes, str)): ...
[ "Return", "a", "decoder", "function", ".", "If", "cfg", "is", "a", "string", "such", "as", "latin", "-", "1", "or", "u", "latin", "-", "1", "then", "we", "return", "a", "new", "lambda", "s", ".", "decode", "()", ".", "If", "cfg", "is", "already", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/log.py#L42-L51
[ "def", "_decoderFromString", "(", "cfg", ")", ":", "if", "isinstance", "(", "cfg", ",", "(", "bytes", ",", "str", ")", ")", ":", "return", "lambda", "s", ":", "s", ".", "decode", "(", "cfg", ",", "'replace'", ")", "return", "cfg" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._getRevDetails
Return a deferred for (date, author, files, comments) of given rev. Deferred will be in error if rev is unknown.
master/buildbot/changes/hgpoller.py
def _getRevDetails(self, rev): """Return a deferred for (date, author, files, comments) of given rev. Deferred will be in error if rev is unknown. """ args = ['log', '-r', rev, os.linesep.join(( '--template={date|hgdate}', '{author}', "{files % '{file...
def _getRevDetails(self, rev): """Return a deferred for (date, author, files, comments) of given rev. Deferred will be in error if rev is unknown. """ args = ['log', '-r', rev, os.linesep.join(( '--template={date|hgdate}', '{author}', "{files % '{file...
[ "Return", "a", "deferred", "for", "(", "date", "author", "files", "comments", ")", "of", "given", "rev", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L111-L142
[ "def", "_getRevDetails", "(", "self", ",", "rev", ")", ":", "args", "=", "[", "'log'", ",", "'-r'", ",", "rev", ",", "os", ".", "linesep", ".", "join", "(", "(", "'--template={date|hgdate}'", ",", "'{author}'", ",", "\"{files % '{file}\"", "+", "os", "."...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._isRepositoryReady
Easy to patch in tests.
master/buildbot/changes/hgpoller.py
def _isRepositoryReady(self): """Easy to patch in tests.""" return os.path.exists(os.path.join(self._absWorkdir(), '.hg'))
def _isRepositoryReady(self): """Easy to patch in tests.""" return os.path.exists(os.path.join(self._absWorkdir(), '.hg'))
[ "Easy", "to", "patch", "in", "tests", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L144-L146
[ "def", "_isRepositoryReady", "(", "self", ")", ":", "return", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_absWorkdir", "(", ")", ",", "'.hg'", ")", ")" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._initRepository
Have mercurial init the workdir as a repository (hg init) if needed. hg init will also create all needed intermediate directories.
master/buildbot/changes/hgpoller.py
def _initRepository(self): """Have mercurial init the workdir as a repository (hg init) if needed. hg init will also create all needed intermediate directories. """ if self._isRepositoryReady(): return defer.succeed(None) log.msg('hgpoller: initializing working dir f...
def _initRepository(self): """Have mercurial init the workdir as a repository (hg init) if needed. hg init will also create all needed intermediate directories. """ if self._isRepositoryReady(): return defer.succeed(None) log.msg('hgpoller: initializing working dir f...
[ "Have", "mercurial", "init", "the", "workdir", "as", "a", "repository", "(", "hg", "init", ")", "if", "needed", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L148-L163
[ "def", "_initRepository", "(", "self", ")", ":", "if", "self", ".", "_isRepositoryReady", "(", ")", ":", "return", "defer", ".", "succeed", "(", "None", ")", "log", ".", "msg", "(", "'hgpoller: initializing working dir from %s'", "%", "self", ".", "repourl", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._setCurrentRev
Return a deferred to set current revision in persistent state.
master/buildbot/changes/hgpoller.py
def _setCurrentRev(self, rev, branch='default'): """Return a deferred to set current revision in persistent state.""" self.lastRev[branch] = str(rev) return self.setState('lastRev', self.lastRev)
def _setCurrentRev(self, rev, branch='default'): """Return a deferred to set current revision in persistent state.""" self.lastRev[branch] = str(rev) return self.setState('lastRev', self.lastRev)
[ "Return", "a", "deferred", "to", "set", "current", "revision", "in", "persistent", "state", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L198-L201
[ "def", "_setCurrentRev", "(", "self", ",", "rev", ",", "branch", "=", "'default'", ")", ":", "self", ".", "lastRev", "[", "branch", "]", "=", "str", "(", "rev", ")", "return", "self", ".", "setState", "(", "'lastRev'", ",", "self", ".", "lastRev", ")...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._getHead
Return a deferred for branch head revision or None. We'll get an error if there is no head for this branch, which is probably a good thing, since it's probably a misspelling (if really buildbotting a branch that does not have any changeset yet, one shouldn't be surprised to get errors)
master/buildbot/changes/hgpoller.py
def _getHead(self, branch): """Return a deferred for branch head revision or None. We'll get an error if there is no head for this branch, which is probably a good thing, since it's probably a misspelling (if really buildbotting a branch that does not have any changeset yet, one...
def _getHead(self, branch): """Return a deferred for branch head revision or None. We'll get an error if there is no head for this branch, which is probably a good thing, since it's probably a misspelling (if really buildbotting a branch that does not have any changeset yet, one...
[ "Return", "a", "deferred", "for", "branch", "head", "revision", "or", "None", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L203-L237
[ "def", "_getHead", "(", "self", ",", "branch", ")", ":", "d", "=", "utils", ".", "getProcessOutput", "(", "self", ".", "hgbin", ",", "[", "'heads'", ",", "'-r'", ",", "branch", ",", "'--template={rev}'", "+", "os", ".", "linesep", "]", ",", "path", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._processChanges
Send info about pulled changes to the master and record current. HgPoller does the recording by moving the working dir to the head of the branch. We don't update the tree (unnecessary treatment and waste of space) instead, we simply store the current rev number in a file. Recall...
master/buildbot/changes/hgpoller.py
def _processChanges(self, unused_output): """Send info about pulled changes to the master and record current. HgPoller does the recording by moving the working dir to the head of the branch. We don't update the tree (unnecessary treatment and waste of space) instead, we simply s...
def _processChanges(self, unused_output): """Send info about pulled changes to the master and record current. HgPoller does the recording by moving the working dir to the head of the branch. We don't update the tree (unnecessary treatment and waste of space) instead, we simply s...
[ "Send", "info", "about", "pulled", "changes", "to", "the", "master", "and", "record", "current", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L240-L254
[ "def", "_processChanges", "(", "self", ",", "unused_output", ")", ":", "for", "branch", "in", "self", ".", "branches", "+", "self", ".", "bookmarks", ":", "rev", "=", "yield", "self", ".", "_getHead", "(", "branch", ")", "if", "rev", "is", "None", ":",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._convertNonZeroToFailure
utility method to handle the result of getProcessOutputAndValue
master/buildbot/changes/hgpoller.py
def _convertNonZeroToFailure(self, res): "utility method to handle the result of getProcessOutputAndValue" (stdout, stderr, code) = res if code != 0: raise EnvironmentError( 'command failed with exit code %d: %s' % (code, stderr)) return (stdout, stderr, code)
def _convertNonZeroToFailure(self, res): "utility method to handle the result of getProcessOutputAndValue" (stdout, stderr, code) = res if code != 0: raise EnvironmentError( 'command failed with exit code %d: %s' % (code, stderr)) return (stdout, stderr, code)
[ "utility", "method", "to", "handle", "the", "result", "of", "getProcessOutputAndValue" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L305-L311
[ "def", "_convertNonZeroToFailure", "(", "self", ",", "res", ")", ":", "(", "stdout", ",", "stderr", ",", "code", ")", "=", "res", "if", "code", "!=", "0", ":", "raise", "EnvironmentError", "(", "'command failed with exit code %d: %s'", "%", "(", "code", ",",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HgPoller._stopOnFailure
utility method to stop the service when a failure occurs
master/buildbot/changes/hgpoller.py
def _stopOnFailure(self, f): "utility method to stop the service when a failure occurs" if self.running: d = defer.maybeDeferred(self.stopService) d.addErrback(log.err, 'while stopping broken HgPoller service') return f
def _stopOnFailure(self, f): "utility method to stop the service when a failure occurs" if self.running: d = defer.maybeDeferred(self.stopService) d.addErrback(log.err, 'while stopping broken HgPoller service') return f
[ "utility", "method", "to", "stop", "the", "service", "when", "a", "failure", "occurs" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/hgpoller.py#L313-L318
[ "def", "_stopOnFailure", "(", "self", ",", "f", ")", ":", "if", "self", ".", "running", ":", "d", "=", "defer", ".", "maybeDeferred", "(", "self", ".", "stopService", ")", "d", ".", "addErrback", "(", "log", ".", "err", ",", "'while stopping broken HgPol...
5df3cfae6d760557d99156633c32b1822a1e130c
train
SVN.purge
Delete everything that shown up on status.
master/buildbot/steps/source/svn.py
def purge(self, ignore_ignores): """Delete everything that shown up on status.""" command = ['status', '--xml'] if ignore_ignores: command.append('--no-ignore') d = self._dovccmd(command, collectStdout=True) @d.addCallback def parseAndRemove(stdout): ...
def purge(self, ignore_ignores): """Delete everything that shown up on status.""" command = ['status', '--xml'] if ignore_ignores: command.append('--no-ignore') d = self._dovccmd(command, collectStdout=True) @d.addCallback def parseAndRemove(stdout): ...
[ "Delete", "everything", "that", "shown", "up", "on", "status", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/svn.py#L338-L366
[ "def", "purge", "(", "self", ",", "ignore_ignores", ")", ":", "command", "=", "[", "'status'", ",", "'--xml'", "]", "if", "ignore_ignores", ":", "command", ".", "append", "(", "'--no-ignore'", ")", "d", "=", "self", ".", "_dovccmd", "(", "command", ",", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
DetermineRunner
Checks if the given directory is a worker or a master and returns the appropriate run function.
master/buildbot/scripts/windows_service.py
def DetermineRunner(bbdir): '''Checks if the given directory is a worker or a master and returns the appropriate run function.''' tacfile = os.path.join(bbdir, 'buildbot.tac') if not os.path.exists(tacfile): # No tac-file - use master runner by default. import buildbot.scripts.runner ...
def DetermineRunner(bbdir): '''Checks if the given directory is a worker or a master and returns the appropriate run function.''' tacfile = os.path.join(bbdir, 'buildbot.tac') if not os.path.exists(tacfile): # No tac-file - use master runner by default. import buildbot.scripts.runner ...
[ "Checks", "if", "the", "given", "directory", "is", "a", "worker", "or", "a", "master", "and", "returns", "the", "appropriate", "run", "function", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/scripts/windows_service.py#L522-L554
[ "def", "DetermineRunner", "(", "bbdir", ")", ":", "tacfile", "=", "os", ".", "path", ".", "join", "(", "bbdir", ",", "'buildbot.tac'", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "tacfile", ")", ":", "# No tac-file - use master runner by default...
5df3cfae6d760557d99156633c32b1822a1e130c
train
P4.purge
Delete everything that shown up on status.
master/buildbot/steps/source/p4.py
def purge(self, ignore_ignores): """Delete everything that shown up on status.""" command = ['sync', '#none'] if ignore_ignores: command.append('--no-ignore') d = self._dovccmd(command, collectStdout=True) # add deferred to rm tree # then add defer to sync t...
def purge(self, ignore_ignores): """Delete everything that shown up on status.""" command = ['sync', '#none'] if ignore_ignores: command.append('--no-ignore') d = self._dovccmd(command, collectStdout=True) # add deferred to rm tree # then add defer to sync t...
[ "Delete", "everything", "that", "shown", "up", "on", "status", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/p4.py#L394-L404
[ "def", "purge", "(", "self", ",", "ignore_ignores", ")", ":", "command", "=", "[", "'sync'", ",", "'#none'", "]", "if", "ignore_ignores", ":", "command", ".", "append", "(", "'--no-ignore'", ")", "d", "=", "self", ".", "_dovccmd", "(", "command", ",", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Repo.filterManifestPatches
Patches to manifest projects are a bit special. repo does not support a way to download them automatically, so we need to implement the boilerplate manually. This code separates the manifest patches from the other patches, and generates commands to import those manifest patches.
master/buildbot/steps/source/repo.py
def filterManifestPatches(self): """ Patches to manifest projects are a bit special. repo does not support a way to download them automatically, so we need to implement the boilerplate manually. This code separates the manifest patches from the other patches, and generate...
def filterManifestPatches(self): """ Patches to manifest projects are a bit special. repo does not support a way to download them automatically, so we need to implement the boilerplate manually. This code separates the manifest patches from the other patches, and generate...
[ "Patches", "to", "manifest", "projects", "are", "a", "bit", "special", ".", "repo", "does", "not", "support", "a", "way", "to", "download", "them", "automatically", "so", "we", "need", "to", "implement", "the", "boilerplate", "manually", ".", "This", "code",...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/repo.py#L181-L204
[ "def", "filterManifestPatches", "(", "self", ")", ":", "manifest_unrelated_downloads", "=", "[", "]", "manifest_related_downloads", "=", "[", "]", "for", "download", "in", "self", ".", "repoDownloads", ":", "project", ",", "ch_ps", "=", "download", ".", "split",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Repo._getCleanupCommand
also used by tests for expectations
master/buildbot/steps/source/repo.py
def _getCleanupCommand(self): """also used by tests for expectations""" return textwrap.dedent("""\ set -v if [ -d .repo/manifests ] then # repo just refuse to run if manifest is messed up # so ensure we are in a known state ...
def _getCleanupCommand(self): """also used by tests for expectations""" return textwrap.dedent("""\ set -v if [ -d .repo/manifests ] then # repo just refuse to run if manifest is messed up # so ensure we are in a known state ...
[ "also", "used", "by", "tests", "for", "expectations" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/repo.py#L438-L461
[ "def", "_getCleanupCommand", "(", "self", ")", ":", "return", "textwrap", ".", "dedent", "(", "\"\"\"\\\n set -v\n if [ -d .repo/manifests ]\n then\n # repo just refuse to run if manifest is messed up\n # so ensure we are in a know...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildMaster.getObjectId
Return the object id for this master, for associating state with the master. @returns: ID, via Deferred
master/buildbot/master.py
def getObjectId(self): """ Return the object id for this master, for associating state with the master. @returns: ID, via Deferred """ # try to get the cached value if self._object_id is not None: return defer.succeed(self._object_id) # faili...
def getObjectId(self): """ Return the object id for this master, for associating state with the master. @returns: ID, via Deferred """ # try to get the cached value if self._object_id is not None: return defer.succeed(self._object_id) # faili...
[ "Return", "the", "object", "id", "for", "this", "master", "for", "associating", "state", "with", "the", "master", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/master.py#L446-L467
[ "def", "getObjectId", "(", "self", ")", ":", "# try to get the cached value", "if", "self", ".", "_object_id", "is", "not", "None", ":", "return", "defer", ".", "succeed", "(", "self", ".", "_object_id", ")", "# failing that, get it from the DB; multiple calls to this...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildMaster._getState
private wrapper around C{self.db.state.getState}
master/buildbot/master.py
def _getState(self, name, default=None): "private wrapper around C{self.db.state.getState}" d = self.getObjectId() @d.addCallback def get(objectid): return self.db.state.getState(objectid, name, default) return d
def _getState(self, name, default=None): "private wrapper around C{self.db.state.getState}" d = self.getObjectId() @d.addCallback def get(objectid): return self.db.state.getState(objectid, name, default) return d
[ "private", "wrapper", "around", "C", "{", "self", ".", "db", ".", "state", ".", "getState", "}" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/master.py#L469-L476
[ "def", "_getState", "(", "self", ",", "name", ",", "default", "=", "None", ")", ":", "d", "=", "self", ".", "getObjectId", "(", ")", "@", "d", ".", "addCallback", "def", "get", "(", "objectid", ")", ":", "return", "self", ".", "db", ".", "state", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildMaster._setState
private wrapper around C{self.db.state.setState}
master/buildbot/master.py
def _setState(self, name, value): "private wrapper around C{self.db.state.setState}" d = self.getObjectId() @d.addCallback def set(objectid): return self.db.state.setState(objectid, name, value) return d
def _setState(self, name, value): "private wrapper around C{self.db.state.setState}" d = self.getObjectId() @d.addCallback def set(objectid): return self.db.state.setState(objectid, name, value) return d
[ "private", "wrapper", "around", "C", "{", "self", ".", "db", ".", "state", ".", "setState", "}" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/master.py#L478-L485
[ "def", "_setState", "(", "self", ",", "name", ",", "value", ")", ":", "d", "=", "self", ".", "getObjectId", "(", ")", "@", "d", ".", "addCallback", "def", "set", "(", "objectid", ")", ":", "return", "self", ".", "db", ".", "state", ".", "setState",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
createUserObject
Take a Change author and source and translate them into a User Object, storing the user in master.db, or returning None if the src is not specified. @param master: link to Buildmaster for database operations @type master: master.Buildmaster instance @param authors: Change author if string or Authz...
master/buildbot/process/users/users.py
def createUserObject(master, author, src=None): """ Take a Change author and source and translate them into a User Object, storing the user in master.db, or returning None if the src is not specified. @param master: link to Buildmaster for database operations @type master: master.Buildmaster in...
def createUserObject(master, author, src=None): """ Take a Change author and source and translate them into a User Object, storing the user in master.db, or returning None if the src is not specified. @param master: link to Buildmaster for database operations @type master: master.Buildmaster in...
[ "Take", "a", "Change", "author", "and", "source", "and", "translate", "them", "into", "a", "User", "Object", "storing", "the", "user", "in", "master", ".", "db", "or", "returning", "None", "if", "the", "src", "is", "not", "specified", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/users/users.py#L32-L61
[ "def", "createUserObject", "(", "master", ",", "author", ",", "src", "=", "None", ")", ":", "if", "not", "src", ":", "log", ".", "msg", "(", "\"No vcs information found, unable to create User Object\"", ")", "return", "defer", ".", "succeed", "(", "None", ")",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
getUserContact
This is a simple getter function that returns a user attribute that matches the contact_types argument, or returns None if no uid/match is found. @param master: BuildMaster used to query the database @type master: BuildMaster instance @param contact_types: list of contact attributes to look for in...
master/buildbot/process/users/users.py
def getUserContact(master, contact_types, uid): """ This is a simple getter function that returns a user attribute that matches the contact_types argument, or returns None if no uid/match is found. @param master: BuildMaster used to query the database @type master: BuildMaster instance @pa...
def getUserContact(master, contact_types, uid): """ This is a simple getter function that returns a user attribute that matches the contact_types argument, or returns None if no uid/match is found. @param master: BuildMaster used to query the database @type master: BuildMaster instance @pa...
[ "This", "is", "a", "simple", "getter", "function", "that", "returns", "a", "user", "attribute", "that", "matches", "the", "contact_types", "argument", "or", "returns", "None", "if", "no", "uid", "/", "match", "is", "found", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/users/users.py#L78-L98
[ "def", "getUserContact", "(", "master", ",", "contact_types", ",", "uid", ")", ":", "d", "=", "master", ".", "db", ".", "users", ".", "getUser", "(", "uid", ")", "d", ".", "addCallback", "(", "_extractContact", ",", "contact_types", ",", "uid", ")", "r...
5df3cfae6d760557d99156633c32b1822a1e130c
train
encrypt
Encrypts the incoming password after adding some salt to store it in the database. @param passwd: password portion of user credentials @type passwd: string @returns: encrypted/salted string
master/buildbot/process/users/users.py
def encrypt(passwd): """ Encrypts the incoming password after adding some salt to store it in the database. @param passwd: password portion of user credentials @type passwd: string @returns: encrypted/salted string """ m = sha1() salt = hexlify(os.urandom(salt_len)) m.update(un...
def encrypt(passwd): """ Encrypts the incoming password after adding some salt to store it in the database. @param passwd: password portion of user credentials @type passwd: string @returns: encrypted/salted string """ m = sha1() salt = hexlify(os.urandom(salt_len)) m.update(un...
[ "Encrypts", "the", "incoming", "password", "after", "adding", "some", "salt", "to", "store", "it", "in", "the", "database", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/users/users.py#L155-L169
[ "def", "encrypt", "(", "passwd", ")", ":", "m", "=", "sha1", "(", ")", "salt", "=", "hexlify", "(", "os", ".", "urandom", "(", "salt_len", ")", ")", "m", ".", "update", "(", "unicode2bytes", "(", "passwd", ")", "+", "salt", ")", "crypted", "=", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
check_passwd
Tests to see if the guess, after salting and hashing, matches the passwd from the database. @param guess: incoming password trying to be used for authentication @param passwd: already encrypted password from the database @returns: boolean
master/buildbot/process/users/users.py
def check_passwd(guess, passwd): """ Tests to see if the guess, after salting and hashing, matches the passwd from the database. @param guess: incoming password trying to be used for authentication @param passwd: already encrypted password from the database @returns: boolean """ m = sh...
def check_passwd(guess, passwd): """ Tests to see if the guess, after salting and hashing, matches the passwd from the database. @param guess: incoming password trying to be used for authentication @param passwd: already encrypted password from the database @returns: boolean """ m = sh...
[ "Tests", "to", "see", "if", "the", "guess", "after", "salting", "and", "hashing", "matches", "the", "passwd", "from", "the", "database", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/users/users.py#L172-L187
[ "def", "check_passwd", "(", "guess", ",", "passwd", ")", ":", "m", "=", "sha1", "(", ")", "salt", "=", "passwd", "[", ":", "salt_len", "*", "2", "]", "# salt_len * 2 due to encode('hex_codec')", "m", ".", "update", "(", "unicode2bytes", "(", "guess", ")", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
OAuth2Auth.getLoginURL
Returns the url to redirect the user to for user consent
master/buildbot/www/oauth2.py
def getLoginURL(self, redirect_url): """ Returns the url to redirect the user to for user consent """ p = Properties() p.master = self.master clientId = yield p.render(self.clientId) oauth_params = {'redirect_uri': self.loginUri, 'client_id...
def getLoginURL(self, redirect_url): """ Returns the url to redirect the user to for user consent """ p = Properties() p.master = self.master clientId = yield p.render(self.clientId) oauth_params = {'redirect_uri': self.loginUri, 'client_id...
[ "Returns", "the", "url", "to", "redirect", "the", "user", "to", "for", "user", "consent" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/oauth2.py#L111-L124
[ "def", "getLoginURL", "(", "self", ",", "redirect_url", ")", ":", "p", "=", "Properties", "(", ")", "p", ".", "master", "=", "self", ".", "master", "clientId", "=", "yield", "p", ".", "render", "(", "self", ".", "clientId", ")", "oauth_params", "=", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_handleLegacyResult
make sure the result is backward compatible
master/buildbot/reporters/gerrit.py
def _handleLegacyResult(result): """ make sure the result is backward compatible """ if not isinstance(result, dict): warnings.warn('The Gerrit status callback uses the old way to ' 'communicate results. The outcome might be not what is ' 'expected.')...
def _handleLegacyResult(result): """ make sure the result is backward compatible """ if not isinstance(result, dict): warnings.warn('The Gerrit status callback uses the old way to ' 'communicate results. The outcome might be not what is ' 'expected.')...
[ "make", "sure", "the", "result", "is", "backward", "compatible" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gerrit.py#L52-L64
[ "def", "_handleLegacyResult", "(", "result", ")", ":", "if", "not", "isinstance", "(", "result", ",", "dict", ")", ":", "warnings", ".", "warn", "(", "'The Gerrit status callback uses the old way to '", "'communicate results. The outcome might be not what is '", "'expected...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GerritStatusPush._gerritCmd
Construct a command as a list of strings suitable for :func:`subprocess.call`.
master/buildbot/reporters/gerrit.py
def _gerritCmd(self, *args): '''Construct a command as a list of strings suitable for :func:`subprocess.call`. ''' if self.gerrit_identity_file is not None: options = ['-i', self.gerrit_identity_file] else: options = [] return ['ssh'] + options + [...
def _gerritCmd(self, *args): '''Construct a command as a list of strings suitable for :func:`subprocess.call`. ''' if self.gerrit_identity_file is not None: options = ['-i', self.gerrit_identity_file] else: options = [] return ['ssh'] + options + [...
[ "Construct", "a", "command", "as", "a", "list", "of", "strings", "suitable", "for", ":", "func", ":", "subprocess", ".", "call", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gerrit.py#L185-L197
[ "def", "_gerritCmd", "(", "self", ",", "*", "args", ")", ":", "if", "self", ".", "gerrit_identity_file", "is", "not", "None", ":", "options", "=", "[", "'-i'", ",", "self", ".", "gerrit_identity_file", "]", "else", ":", "options", "=", "[", "]", "retur...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildRequestDistributor.maybeStartBuildsOn
Try to start any builds that can be started right now. This function returns immediately, and promises to trigger those builders eventually. @param new_builders: names of new builders that should be given the opportunity to check for new requests.
master/buildbot/process/buildrequestdistributor.py
def maybeStartBuildsOn(self, new_builders): """ Try to start any builds that can be started right now. This function returns immediately, and promises to trigger those builders eventually. @param new_builders: names of new builders that should be given the opportunity t...
def maybeStartBuildsOn(self, new_builders): """ Try to start any builds that can be started right now. This function returns immediately, and promises to trigger those builders eventually. @param new_builders: names of new builders that should be given the opportunity t...
[ "Try", "to", "start", "any", "builds", "that", "can", "be", "started", "right", "now", ".", "This", "function", "returns", "immediately", "and", "promises", "to", "trigger", "those", "builders", "eventually", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequestdistributor.py#L318-L338
[ "def", "maybeStartBuildsOn", "(", "self", ",", "new_builders", ")", ":", "if", "not", "self", ".", "running", ":", "return", "d", "=", "self", ".", "_maybeStartBuildsOn", "(", "new_builders", ")", "self", ".", "_pendingMSBOCalls", ".", "append", "(", "d", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.addLogForRemoteCommands
This method must be called by user classes composite steps could create several logs, this mixin functions will write to the last one.
master/buildbot/steps/worker.py
def addLogForRemoteCommands(self, logname): """This method must be called by user classes composite steps could create several logs, this mixin functions will write to the last one. """ self.rc_log = self.addLog(logname) return self.rc_log
def addLogForRemoteCommands(self, logname): """This method must be called by user classes composite steps could create several logs, this mixin functions will write to the last one. """ self.rc_log = self.addLog(logname) return self.rc_log
[ "This", "method", "must", "be", "called", "by", "user", "classes", "composite", "steps", "could", "create", "several", "logs", "this", "mixin", "functions", "will", "write", "to", "the", "last", "one", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L236-L242
[ "def", "addLogForRemoteCommands", "(", "self", ",", "logname", ")", ":", "self", ".", "rc_log", "=", "self", ".", "addLog", "(", "logname", ")", "return", "self", ".", "rc_log" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.runRemoteCommand
generic RemoteCommand boilerplate
master/buildbot/steps/worker.py
def runRemoteCommand(self, cmd, args, abandonOnFailure=True, evaluateCommand=lambda cmd: cmd.didFail()): """generic RemoteCommand boilerplate""" cmd = remotecommand.RemoteCommand(cmd, args) if hasattr(self, "rc_log"): cmd.useLog(self.rc_log, False) d ...
def runRemoteCommand(self, cmd, args, abandonOnFailure=True, evaluateCommand=lambda cmd: cmd.didFail()): """generic RemoteCommand boilerplate""" cmd = remotecommand.RemoteCommand(cmd, args) if hasattr(self, "rc_log"): cmd.useLog(self.rc_log, False) d ...
[ "generic", "RemoteCommand", "boilerplate" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L244-L258
[ "def", "runRemoteCommand", "(", "self", ",", "cmd", ",", "args", ",", "abandonOnFailure", "=", "True", ",", "evaluateCommand", "=", "lambda", "cmd", ":", "cmd", ".", "didFail", "(", ")", ")", ":", "cmd", "=", "remotecommand", ".", "RemoteCommand", "(", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.runRmdir
remove a directory from the worker
master/buildbot/steps/worker.py
def runRmdir(self, dir, timeout=None, **kwargs): """ remove a directory from the worker """ cmd_args = {'dir': dir, 'logEnviron': self.logEnviron} if timeout: cmd_args['timeout'] = timeout return self.runRemoteCommand('rmdir', cmd_args, **kwargs)
def runRmdir(self, dir, timeout=None, **kwargs): """ remove a directory from the worker """ cmd_args = {'dir': dir, 'logEnviron': self.logEnviron} if timeout: cmd_args['timeout'] = timeout return self.runRemoteCommand('rmdir', cmd_args, **kwargs)
[ "remove", "a", "directory", "from", "the", "worker" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L260-L265
[ "def", "runRmdir", "(", "self", ",", "dir", ",", "timeout", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cmd_args", "=", "{", "'dir'", ":", "dir", ",", "'logEnviron'", ":", "self", ".", "logEnviron", "}", "if", "timeout", ":", "cmd_args", "[", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.runRmFile
remove a file from the worker
master/buildbot/steps/worker.py
def runRmFile(self, path, timeout=None, **kwargs): """ remove a file from the worker """ cmd_args = {'path': path, 'logEnviron': self.logEnviron} if timeout: cmd_args['timeout'] = timeout if self.workerVersionIsOlderThan('rmfile', '3.1'): cmd_args['dir'] = os.path...
def runRmFile(self, path, timeout=None, **kwargs): """ remove a file from the worker """ cmd_args = {'path': path, 'logEnviron': self.logEnviron} if timeout: cmd_args['timeout'] = timeout if self.workerVersionIsOlderThan('rmfile', '3.1'): cmd_args['dir'] = os.path...
[ "remove", "a", "file", "from", "the", "worker" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L267-L275
[ "def", "runRmFile", "(", "self", ",", "path", ",", "timeout", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cmd_args", "=", "{", "'path'", ":", "path", ",", "'logEnviron'", ":", "self", ".", "logEnviron", "}", "if", "timeout", ":", "cmd_args", "["...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.pathExists
test whether path exists
master/buildbot/steps/worker.py
def pathExists(self, path): """ test whether path exists""" def commandComplete(cmd): return not cmd.didFail() return self.runRemoteCommand('stat', {'file': path, 'logEnviron': self.logEnviron, }, aba...
def pathExists(self, path): """ test whether path exists""" def commandComplete(cmd): return not cmd.didFail() return self.runRemoteCommand('stat', {'file': path, 'logEnviron': self.logEnviron, }, aba...
[ "test", "whether", "path", "exists" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L277-L285
[ "def", "pathExists", "(", "self", ",", "path", ")", ":", "def", "commandComplete", "(", "cmd", ")", ":", "return", "not", "cmd", ".", "didFail", "(", ")", "return", "self", ".", "runRemoteCommand", "(", "'stat'", ",", "{", "'file'", ":", "path", ",", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.runMkdir
create a directory and its parents
master/buildbot/steps/worker.py
def runMkdir(self, _dir, **kwargs): """ create a directory and its parents""" return self.runRemoteCommand('mkdir', {'dir': _dir, 'logEnviron': self.logEnviron, }, **kwargs)
def runMkdir(self, _dir, **kwargs): """ create a directory and its parents""" return self.runRemoteCommand('mkdir', {'dir': _dir, 'logEnviron': self.logEnviron, }, **kwargs)
[ "create", "a", "directory", "and", "its", "parents" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L287-L291
[ "def", "runMkdir", "(", "self", ",", "_dir", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "runRemoteCommand", "(", "'mkdir'", ",", "{", "'dir'", ":", "_dir", ",", "'logEnviron'", ":", "self", ".", "logEnviron", ",", "}", ",", "*", "*", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
CompositeStepMixin.runGlob
find files matching a shell-style pattern
master/buildbot/steps/worker.py
def runGlob(self, path, **kwargs): """ find files matching a shell-style pattern""" def commandComplete(cmd): return cmd.updates['files'][-1] return self.runRemoteCommand('glob', {'path': path, 'logEnviron': self.logEnviron, }, ...
def runGlob(self, path, **kwargs): """ find files matching a shell-style pattern""" def commandComplete(cmd): return cmd.updates['files'][-1] return self.runRemoteCommand('glob', {'path': path, 'logEnviron': self.logEnviron, }, ...
[ "find", "files", "matching", "a", "shell", "-", "style", "pattern" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/worker.py#L293-L300
[ "def", "runGlob", "(", "self", ",", "path", ",", "*", "*", "kwargs", ")", ":", "def", "commandComplete", "(", "cmd", ")", ":", "return", "cmd", ".", "updates", "[", "'files'", "]", "[", "-", "1", "]", "return", "self", ".", "runRemoteCommand", "(", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_compat_name
Returns old API ("slave") name for new name ("worker"). >>> assert _compat_name("Worker") == "Slave" >>> assert _compat_name("SomeWorkerStuff") == "SomeSlaveStuff" >>> assert _compat_name("SomeWorker", compat_name="SomeBuildSlave") == \ "SomeBuildSlave" If `compat_name` is not specified old na...
master/buildbot/worker_transition.py
def _compat_name(new_name, compat_name=None): """Returns old API ("slave") name for new name ("worker"). >>> assert _compat_name("Worker") == "Slave" >>> assert _compat_name("SomeWorkerStuff") == "SomeSlaveStuff" >>> assert _compat_name("SomeWorker", compat_name="SomeBuildSlave") == \ "SomeBuil...
def _compat_name(new_name, compat_name=None): """Returns old API ("slave") name for new name ("worker"). >>> assert _compat_name("Worker") == "Slave" >>> assert _compat_name("SomeWorkerStuff") == "SomeSlaveStuff" >>> assert _compat_name("SomeWorker", compat_name="SomeBuildSlave") == \ "SomeBuil...
[ "Returns", "old", "API", "(", "slave", ")", "name", "for", "new", "name", "(", "worker", ")", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/worker_transition.py#L37-L74
[ "def", "_compat_name", "(", "new_name", ",", "compat_name", "=", "None", ")", ":", "if", "compat_name", "is", "not", "None", ":", "assert", "\"slave\"", "in", "compat_name", ".", "lower", "(", ")", "assert", "new_name", "==", "\"\"", "or", "\"worker\"", "i...
5df3cfae6d760557d99156633c32b1822a1e130c
train
reportDeprecatedWorkerNameUsage
Hook that is ran when old API name is used. :param stacklevel: stack level relative to the caller's frame. Defaults to caller of the caller of this function.
master/buildbot/worker_transition.py
def reportDeprecatedWorkerNameUsage(message, stacklevel=None, filename=None, lineno=None): """Hook that is ran when old API name is used. :param stacklevel: stack level relative to the caller's frame. Defaults to caller of the caller of this function. """ if fil...
def reportDeprecatedWorkerNameUsage(message, stacklevel=None, filename=None, lineno=None): """Hook that is ran when old API name is used. :param stacklevel: stack level relative to the caller's frame. Defaults to caller of the caller of this function. """ if fil...
[ "Hook", "that", "is", "ran", "when", "old", "API", "name", "is", "used", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/worker_transition.py#L102-L128
[ "def", "reportDeprecatedWorkerNameUsage", "(", "message", ",", "stacklevel", "=", "None", ",", "filename", "=", "None", ",", "lineno", "=", "None", ")", ":", "if", "filename", "is", "None", ":", "if", "stacklevel", "is", "None", ":", "# Warning will refer to t...
5df3cfae6d760557d99156633c32b1822a1e130c
train
setupWorkerTransition
Hook Twisted deprecation machinery to use custom warning class for Worker API deprecation warnings.
master/buildbot/worker_transition.py
def setupWorkerTransition(): """Hook Twisted deprecation machinery to use custom warning class for Worker API deprecation warnings.""" default_warn_method = getWarningMethod() def custom_warn_method(message, category, stacklevel): if stacklevel is not None: stacklevel += 1 ...
def setupWorkerTransition(): """Hook Twisted deprecation machinery to use custom warning class for Worker API deprecation warnings.""" default_warn_method = getWarningMethod() def custom_warn_method(message, category, stacklevel): if stacklevel is not None: stacklevel += 1 ...
[ "Hook", "Twisted", "deprecation", "machinery", "to", "use", "custom", "warning", "class", "for", "Worker", "API", "deprecation", "warnings", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/worker_transition.py#L131-L150
[ "def", "setupWorkerTransition", "(", ")", ":", "default_warn_method", "=", "getWarningMethod", "(", ")", "def", "custom_warn_method", "(", "message", ",", "category", ",", "stacklevel", ")", ":", "if", "stacklevel", "is", "not", "None", ":", "stacklevel", "+=", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Git._fetchOrFallback
Handles fallbacks for failure of fetch, wrapper for self._fetch
master/buildbot/steps/source/git.py
def _fetchOrFallback(self, _=None): """ Handles fallbacks for failure of fetch, wrapper for self._fetch """ res = yield self._fetch(None) if res == RC_SUCCESS: return res elif self.retryFetch: yield self._fetch(None) elif self.clobb...
def _fetchOrFallback(self, _=None): """ Handles fallbacks for failure of fetch, wrapper for self._fetch """ res = yield self._fetch(None) if res == RC_SUCCESS: return res elif self.retryFetch: yield self._fetch(None) elif self.clobb...
[ "Handles", "fallbacks", "for", "failure", "of", "fetch", "wrapper", "for", "self", ".", "_fetch" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/git.py#L348-L361
[ "def", "_fetchOrFallback", "(", "self", ",", "_", "=", "None", ")", ":", "res", "=", "yield", "self", ".", "_fetch", "(", "None", ")", "if", "res", "==", "RC_SUCCESS", ":", "return", "res", "elif", "self", ".", "retryFetch", ":", "yield", "self", "."...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Git._clone
Retry if clone failed
master/buildbot/steps/source/git.py
def _clone(self, shallowClone): """Retry if clone failed""" command = ['clone'] switchToBranch = False if self.supportsBranch and self.branch != 'HEAD': if self.branch.startswith('refs/'): # we can't choose this branch from 'git clone' directly; we ...
def _clone(self, shallowClone): """Retry if clone failed""" command = ['clone'] switchToBranch = False if self.supportsBranch and self.branch != 'HEAD': if self.branch.startswith('refs/'): # we can't choose this branch from 'git clone' directly; we ...
[ "Retry", "if", "clone", "failed" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/git.py#L364-L411
[ "def", "_clone", "(", "self", ",", "shallowClone", ")", ":", "command", "=", "[", "'clone'", "]", "switchToBranch", "=", "False", "if", "self", ".", "supportsBranch", "and", "self", ".", "branch", "!=", "'HEAD'", ":", "if", "self", ".", "branch", ".", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Git._fullClone
Perform full clone and checkout to the revision if specified In the case of shallow clones if any of the step fail abort whole build step.
master/buildbot/steps/source/git.py
def _fullClone(self, shallowClone=False): """Perform full clone and checkout to the revision if specified In the case of shallow clones if any of the step fail abort whole build step. """ res = yield self._clone(shallowClone) if res != RC_SUCCESS: return res ...
def _fullClone(self, shallowClone=False): """Perform full clone and checkout to the revision if specified In the case of shallow clones if any of the step fail abort whole build step. """ res = yield self._clone(shallowClone) if res != RC_SUCCESS: return res ...
[ "Perform", "full", "clone", "and", "checkout", "to", "the", "revision", "if", "specified", "In", "the", "case", "of", "shallow", "clones", "if", "any", "of", "the", "step", "fail", "abort", "whole", "build", "step", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/git.py#L414-L434
[ "def", "_fullClone", "(", "self", ",", "shallowClone", "=", "False", ")", ":", "res", "=", "yield", "self", ".", "_clone", "(", "shallowClone", ")", "if", "res", "!=", "RC_SUCCESS", ":", "return", "res", "# If revision specified checkout that revision", "if", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Git._fullCloneOrFallback
Wrapper for _fullClone(). In the case of failure, if clobberOnFailure is set to True remove the build directory and try a full clone again.
master/buildbot/steps/source/git.py
def _fullCloneOrFallback(self): """Wrapper for _fullClone(). In the case of failure, if clobberOnFailure is set to True remove the build directory and try a full clone again. """ res = yield self._fullClone() if res != RC_SUCCESS: if not self.clobberOnFailure: ...
def _fullCloneOrFallback(self): """Wrapper for _fullClone(). In the case of failure, if clobberOnFailure is set to True remove the build directory and try a full clone again. """ res = yield self._fullClone() if res != RC_SUCCESS: if not self.clobberOnFailure: ...
[ "Wrapper", "for", "_fullClone", "()", ".", "In", "the", "case", "of", "failure", "if", "clobberOnFailure", "is", "set", "to", "True", "remove", "the", "build", "directory", "and", "try", "a", "full", "clone", "again", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/git.py#L437-L447
[ "def", "_fullCloneOrFallback", "(", "self", ")", ":", "res", "=", "yield", "self", ".", "_fullClone", "(", ")", "if", "res", "!=", "RC_SUCCESS", ":", "if", "not", "self", ".", "clobberOnFailure", ":", "raise", "buildstep", ".", "BuildStepFailed", "(", ")",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Git._doClobber
Remove the work directory
master/buildbot/steps/source/git.py
def _doClobber(self): """Remove the work directory""" rc = yield self.runRmdir(self.workdir, timeout=self.timeout) if rc != RC_SUCCESS: raise RuntimeError("Failed to delete directory") return rc
def _doClobber(self): """Remove the work directory""" rc = yield self.runRmdir(self.workdir, timeout=self.timeout) if rc != RC_SUCCESS: raise RuntimeError("Failed to delete directory") return rc
[ "Remove", "the", "work", "directory" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/git.py#L450-L455
[ "def", "_doClobber", "(", "self", ")", ":", "rc", "=", "yield", "self", ".", "runRmdir", "(", "self", ".", "workdir", ",", "timeout", "=", "self", ".", "timeout", ")", "if", "rc", "!=", "RC_SUCCESS", ":", "raise", "RuntimeError", "(", "\"Failed to delete...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BitBucketHandler.getChanges
Catch a POST request from BitBucket and start a build process Check the URL below if you require more information about payload https://confluence.atlassian.com/display/BITBUCKET/POST+Service+Management :param request: the http request Twisted object :param options: additional options
master/buildbot/www/hooks/bitbucket.py
def getChanges(self, request): """Catch a POST request from BitBucket and start a build process Check the URL below if you require more information about payload https://confluence.atlassian.com/display/BITBUCKET/POST+Service+Management :param request: the http request Twisted object ...
def getChanges(self, request): """Catch a POST request from BitBucket and start a build process Check the URL below if you require more information about payload https://confluence.atlassian.com/display/BITBUCKET/POST+Service+Management :param request: the http request Twisted object ...
[ "Catch", "a", "POST", "request", "from", "BitBucket", "and", "start", "a", "build", "process" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/bitbucket.py#L32-L69
[ "def", "getChanges", "(", "self", ",", "request", ")", ":", "event_type", "=", "request", ".", "getHeader", "(", "_HEADER_EVENT", ")", "event_type", "=", "bytes2unicode", "(", "event_type", ")", "payload", "=", "json", ".", "loads", "(", "bytes2unicode", "("...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Db2DataMixin._generate_filtered_properties
This method returns Build's properties according to property filters. :param props: Properties as a dict (from db) :param filters: Desired properties keys as a list (from API URI)
master/buildbot/data/buildrequests.py
def _generate_filtered_properties(self, props, filters): """ This method returns Build's properties according to property filters. :param props: Properties as a dict (from db) :param filters: Desired properties keys as a list (from API URI) """ # by default no properties...
def _generate_filtered_properties(self, props, filters): """ This method returns Build's properties according to property filters. :param props: Properties as a dict (from db) :param filters: Desired properties keys as a list (from API URI) """ # by default no properties...
[ "This", "method", "returns", "Build", "s", "properties", "according", "to", "property", "filters", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/data/buildrequests.py#L28-L39
[ "def", "_generate_filtered_properties", "(", "self", ",", "props", ",", "filters", ")", ":", "# by default no properties are returned", "if", "props", "and", "filters", ":", "return", "(", "props", "if", "'*'", "in", "filters", "else", "dict", "(", "(", "(", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
HashiCorpVaultSecretProvider.get
get the value from vault secret backend
master/buildbot/secrets/providers/vault.py
def get(self, entry): """ get the value from vault secret backend """ if self.apiVersion == 1: path = self.secretsmount + '/' + entry else: path = self.secretsmount + '/data/' + entry # note that the HTTP path contains v1 for both versions of the ...
def get(self, entry): """ get the value from vault secret backend """ if self.apiVersion == 1: path = self.secretsmount + '/' + entry else: path = self.secretsmount + '/data/' + entry # note that the HTTP path contains v1 for both versions of the ...
[ "get", "the", "value", "from", "vault", "secret", "backend" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/secrets/providers/vault.py#L59-L82
[ "def", "get", "(", "self", ",", "entry", ")", ":", "if", "self", ".", "apiVersion", "==", "1", ":", "path", "=", "self", ".", "secretsmount", "+", "'/'", "+", "entry", "else", ":", "path", "=", "self", ".", "secretsmount", "+", "'/data/'", "+", "en...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GerritVerifyStatusPush.createStatus
Abstract the POST REST api documented here: https://gerrit.googlesource.com/plugins/verify-status/+/master/src/main/resources/Documentation/rest-api-changes.md :param change_id: The change_id for the change tested (can be in the long form e.g: myProject~master~I8473b95934b5732ac55d26311a706...
master/buildbot/reporters/gerrit_verify_status.py
def createStatus(self, change_id, revision_id, name, value, abstain=None, rerun=None, comment=None, url=None, reporter=None, ...
def createStatus(self, change_id, revision_id, name, value, abstain=None, rerun=None, comment=None, url=None, reporter=None, ...
[ "Abstract", "the", "POST", "REST", "api", "documented", "here", ":", "https", ":", "//", "gerrit", ".", "googlesource", ".", "com", "/", "plugins", "/", "verify", "-", "status", "/", "+", "/", "master", "/", "src", "/", "main", "/", "resources", "/", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gerrit_verify_status.py#L82-L149
[ "def", "createStatus", "(", "self", ",", "change_id", ",", "revision_id", ",", "name", ",", "value", ",", "abstain", "=", "None", ",", "rerun", "=", "None", ",", "comment", "=", "None", ",", "url", "=", "None", ",", "reporter", "=", "None", ",", "cat...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GerritVerifyStatusPush.formatDuration
Format the duration. This method could be overridden if really needed, as the duration format in gerrit is an arbitrary string. :param duration: duration in timedelta
master/buildbot/reporters/gerrit_verify_status.py
def formatDuration(self, duration): """Format the duration. This method could be overridden if really needed, as the duration format in gerrit is an arbitrary string. :param duration: duration in timedelta """ days = duration.days hours, remainder = divmod(durati...
def formatDuration(self, duration): """Format the duration. This method could be overridden if really needed, as the duration format in gerrit is an arbitrary string. :param duration: duration in timedelta """ days = duration.days hours, remainder = divmod(durati...
[ "Format", "the", "duration", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gerrit_verify_status.py#L151-L166
[ "def", "formatDuration", "(", "self", ",", "duration", ")", ":", "days", "=", "duration", ".", "days", "hours", ",", "remainder", "=", "divmod", "(", "duration", ".", "seconds", ",", "3600", ")", "minutes", ",", "seconds", "=", "divmod", "(", "remainder"...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GerritVerifyStatusPush.getGerritChanges
Get the gerrit changes This method could be overridden if really needed to accommodate for other custom steps method for fetching gerrit changes. :param props: an IProperty :return: (optionally via deferred) a list of dictionary with at list change_id, ...
master/buildbot/reporters/gerrit_verify_status.py
def getGerritChanges(props): """ Get the gerrit changes This method could be overridden if really needed to accommodate for other custom steps method for fetching gerrit changes. :param props: an IProperty :return: (optionally via deferred) a list of dictionary...
def getGerritChanges(props): """ Get the gerrit changes This method could be overridden if really needed to accommodate for other custom steps method for fetching gerrit changes. :param props: an IProperty :return: (optionally via deferred) a list of dictionary...
[ "Get", "the", "gerrit", "changes" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gerrit_verify_status.py#L169-L190
[ "def", "getGerritChanges", "(", "props", ")", ":", "if", "'gerrit_changes'", "in", "props", ":", "return", "props", ".", "getProperty", "(", "'gerrit_changes'", ")", "if", "'event.change.number'", "in", "props", ":", "return", "[", "{", "'change_id'", ":", "pr...
5df3cfae6d760557d99156633c32b1822a1e130c
train
DetermineRunner
Checks if the given directory is a buildbot worker or a master and returns the appropriate run function.
worker/buildbot_worker/scripts/windows_service.py
def DetermineRunner(bbdir): '''Checks if the given directory is a buildbot worker or a master and returns the appropriate run function.''' try: import buildbot_worker.scripts.runner tacfile = os.path.join(bbdir, 'buildbot.tac') if os.path.exists(tacfile): with open(tacfi...
def DetermineRunner(bbdir): '''Checks if the given directory is a buildbot worker or a master and returns the appropriate run function.''' try: import buildbot_worker.scripts.runner tacfile = os.path.join(bbdir, 'buildbot.tac') if os.path.exists(tacfile): with open(tacfi...
[ "Checks", "if", "the", "given", "directory", "is", "a", "buildbot", "worker", "or", "a", "master", "and", "returns", "the", "appropriate", "run", "function", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/windows_service.py#L584-L602
[ "def", "DetermineRunner", "(", "bbdir", ")", ":", "try", ":", "import", "buildbot_worker", ".", "scripts", ".", "runner", "tacfile", "=", "os", ".", "path", ".", "join", "(", "bbdir", ",", "'buildbot.tac'", ")", "if", "os", ".", "path", ".", "exists", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
LogsConnectorComponent._splitBigChunk
Split CONTENT on a line boundary into a prefix smaller than 64k and a suffix containing the remainder, omitting the splitting newline.
master/buildbot/db/logs.py
def _splitBigChunk(self, content, logid): """ Split CONTENT on a line boundary into a prefix smaller than 64k and a suffix containing the remainder, omitting the splitting newline. """ # if it's small enough, just return it if len(content) < self.MAX_CHUNK_SIZE: ...
def _splitBigChunk(self, content, logid): """ Split CONTENT on a line boundary into a prefix smaller than 64k and a suffix containing the remainder, omitting the splitting newline. """ # if it's small enough, just return it if len(content) < self.MAX_CHUNK_SIZE: ...
[ "Split", "CONTENT", "on", "a", "line", "boundary", "into", "a", "prefix", "smaller", "than", "64k", "and", "a", "suffix", "containing", "the", "remainder", "omitting", "the", "splitting", "newline", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/db/logs.py#L220-L249
[ "def", "_splitBigChunk", "(", "self", ",", "content", ",", "logid", ")", ":", "# if it's small enough, just return it", "if", "len", "(", "content", ")", "<", "self", ".", "MAX_CHUNK_SIZE", ":", "return", "content", ",", "None", "# find the last newline before the l...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildbotSession.updateSession
Update the cookie after session object was modified @param request: the request object which should get a new cookie
master/buildbot/www/service.py
def updateSession(self, request): """ Update the cookie after session object was modified @param request: the request object which should get a new cookie """ # we actually need to copy some hardcoded constants from twisted :-( # Make sure we aren't creating a secure ses...
def updateSession(self, request): """ Update the cookie after session object was modified @param request: the request object which should get a new cookie """ # we actually need to copy some hardcoded constants from twisted :-( # Make sure we aren't creating a secure ses...
[ "Update", "the", "cookie", "after", "session", "object", "was", "modified" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/service.py#L91-L108
[ "def", "updateSession", "(", "self", ",", "request", ")", ":", "# we actually need to copy some hardcoded constants from twisted :-(", "# Make sure we aren't creating a secure session on a non-secure page", "secure", "=", "request", ".", "isSecure", "(", ")", "if", "not", "secu...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildbotSession.uid
uid is now generated automatically according to the claims. This should actually only be used for cookie generation
master/buildbot/www/service.py
def uid(self): """uid is now generated automatically according to the claims. This should actually only be used for cookie generation """ exp = datetime.datetime.utcnow() + self.expDelay claims = { 'user_info': self.user_info, # Note that we use JWT stand...
def uid(self): """uid is now generated automatically according to the claims. This should actually only be used for cookie generation """ exp = datetime.datetime.utcnow() + self.expDelay claims = { 'user_info': self.user_info, # Note that we use JWT stand...
[ "uid", "is", "now", "generated", "automatically", "according", "to", "the", "claims", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/service.py#L122-L134
[ "def", "uid", "(", "self", ")", ":", "exp", "=", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "+", "self", ".", "expDelay", "claims", "=", "{", "'user_info'", ":", "self", ".", "user_info", ",", "# Note that we use JWT standard 'exp' field to implemen...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_makeBaseDir
Make worker base directory if needed. @param basedir: worker base directory relative path @param quiet: if True, don't print info messages @raise CreateWorkerError: on error making base directory
worker/buildbot_worker/scripts/create_worker.py
def _makeBaseDir(basedir, quiet): """ Make worker base directory if needed. @param basedir: worker base directory relative path @param quiet: if True, don't print info messages @raise CreateWorkerError: on error making base directory """ if os.path.exists(basedir): if not quiet: ...
def _makeBaseDir(basedir, quiet): """ Make worker base directory if needed. @param basedir: worker base directory relative path @param quiet: if True, don't print info messages @raise CreateWorkerError: on error making base directory """ if os.path.exists(basedir): if not quiet: ...
[ "Make", "worker", "base", "directory", "if", "needed", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/create_worker.py#L77-L98
[ "def", "_makeBaseDir", "(", "basedir", ",", "quiet", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "basedir", ")", ":", "if", "not", "quiet", ":", "print", "(", "\"updating existing installation\"", ")", "return", "if", "not", "quiet", ":", "pri...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_makeBuildbotTac
Create buildbot.tac file. If buildbot.tac file already exists with different contents, create buildbot.tac.new instead. @param basedir: worker base directory relative path @param tac_file_contents: contents of buildbot.tac file to write @param quiet: if True, don't print info messages @raise Creat...
worker/buildbot_worker/scripts/create_worker.py
def _makeBuildbotTac(basedir, tac_file_contents, quiet): """ Create buildbot.tac file. If buildbot.tac file already exists with different contents, create buildbot.tac.new instead. @param basedir: worker base directory relative path @param tac_file_contents: contents of buildbot.tac file to write ...
def _makeBuildbotTac(basedir, tac_file_contents, quiet): """ Create buildbot.tac file. If buildbot.tac file already exists with different contents, create buildbot.tac.new instead. @param basedir: worker base directory relative path @param tac_file_contents: contents of buildbot.tac file to write ...
[ "Create", "buildbot", ".", "tac", "file", ".", "If", "buildbot", ".", "tac", "file", "already", "exists", "with", "different", "contents", "create", "buildbot", ".", "tac", ".", "new", "instead", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/create_worker.py#L101-L139
[ "def", "_makeBuildbotTac", "(", "basedir", ",", "tac_file_contents", ",", "quiet", ")", ":", "tacfile", "=", "os", ".", "path", ".", "join", "(", "basedir", ",", "\"buildbot.tac\"", ")", "if", "os", ".", "path", ".", "exists", "(", "tacfile", ")", ":", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_makeInfoFiles
Create info/* files inside basedir. @param basedir: worker base directory relative path @param quiet: if True, don't print info messages @raise CreateWorkerError: on error making info directory or writing info files
worker/buildbot_worker/scripts/create_worker.py
def _makeInfoFiles(basedir, quiet): """ Create info/* files inside basedir. @param basedir: worker base directory relative path @param quiet: if True, don't print info messages @raise CreateWorkerError: on error making info directory or writing info files """ ...
def _makeInfoFiles(basedir, quiet): """ Create info/* files inside basedir. @param basedir: worker base directory relative path @param quiet: if True, don't print info messages @raise CreateWorkerError: on error making info directory or writing info files """ ...
[ "Create", "info", "/", "*", "files", "inside", "basedir", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/create_worker.py#L142-L195
[ "def", "_makeInfoFiles", "(", "basedir", ",", "quiet", ")", ":", "def", "createFile", "(", "path", ",", "file", ",", "contents", ")", ":", "filepath", "=", "os", ".", "path", ".", "join", "(", "path", ",", "file", ")", "if", "os", ".", "path", ".",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BitbucketStatusPush.get_owner_and_repo
Takes a git repository URL from Bitbucket and tries to determine the owner and repository name :param repourl: Bitbucket git repo in the form of git@bitbucket.com:OWNER/REPONAME.git https://bitbucket.com/OWNER/REPONAME.git ssh://git@bitbucket.com/OWNER...
master/buildbot/reporters/bitbucket.py
def get_owner_and_repo(repourl): """ Takes a git repository URL from Bitbucket and tries to determine the owner and repository name :param repourl: Bitbucket git repo in the form of git@bitbucket.com:OWNER/REPONAME.git https://bitbucket.com/OWNER/REPONAME....
def get_owner_and_repo(repourl): """ Takes a git repository URL from Bitbucket and tries to determine the owner and repository name :param repourl: Bitbucket git repo in the form of git@bitbucket.com:OWNER/REPONAME.git https://bitbucket.com/OWNER/REPONAME....
[ "Takes", "a", "git", "repository", "URL", "from", "Bitbucket", "and", "tries", "to", "determine", "the", "owner", "and", "repository", "name", ":", "param", "repourl", ":", "Bitbucket", "git", "repo", "in", "the", "form", "of", "git" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/bitbucket.py#L103-L129
[ "def", "get_owner_and_repo", "(", "repourl", ")", ":", "parsed", "=", "urlparse", "(", "repourl", ")", "if", "parsed", ".", "scheme", ":", "path", "=", "parsed", ".", "path", "[", "1", ":", "]", "else", ":", "# we assume git@host:owner/repo.git here", "path"...
5df3cfae6d760557d99156633c32b1822a1e130c
train
ChangesConnectorComponent.pruneChanges
Called periodically by DBConnector, this method deletes changes older than C{changeHorizon}.
master/buildbot/db/changes.py
def pruneChanges(self, changeHorizon): """ Called periodically by DBConnector, this method deletes changes older than C{changeHorizon}. """ if not changeHorizon: return None def thd(conn): changes_tbl = self.db.model.changes # First,...
def pruneChanges(self, changeHorizon): """ Called periodically by DBConnector, this method deletes changes older than C{changeHorizon}. """ if not changeHorizon: return None def thd(conn): changes_tbl = self.db.model.changes # First,...
[ "Called", "periodically", "by", "DBConnector", "this", "method", "deletes", "changes", "older", "than", "C", "{", "changeHorizon", "}", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/db/changes.py#L309-L341
[ "def", "pruneChanges", "(", "self", ",", "changeHorizon", ")", ":", "if", "not", "changeHorizon", ":", "return", "None", "def", "thd", "(", "conn", ")", ":", "changes_tbl", "=", "self", ".", "db", ".", "model", ".", "changes", "# First, get the list of chang...
5df3cfae6d760557d99156633c32b1822a1e130c
train
checkPidFile
mostly comes from _twistd_unix.py which is not twisted public API :-/ except it returns an exception instead of exiting
master/buildbot/scripts/base.py
def checkPidFile(pidfile): """ mostly comes from _twistd_unix.py which is not twisted public API :-/ except it returns an exception instead of exiting """ if os.path.exists(pidfile): try: with open(pidfile) as f: pid = int(f.read()) except ValueError: ...
def checkPidFile(pidfile): """ mostly comes from _twistd_unix.py which is not twisted public API :-/ except it returns an exception instead of exiting """ if os.path.exists(pidfile): try: with open(pidfile) as f: pid = int(f.read()) except ValueError: ...
[ "mostly", "comes", "from", "_twistd_unix", ".", "py", "which", "is", "not", "twisted", "public", "API", ":", "-", "/" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/scripts/base.py#L44-L66
[ "def", "checkPidFile", "(", "pidfile", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "pidfile", ")", ":", "try", ":", "with", "open", "(", "pidfile", ")", "as", "f", ":", "pid", "=", "int", "(", "f", ".", "read", "(", ")", ")", "except...
5df3cfae6d760557d99156633c32b1822a1e130c
train
SubcommandOptions.loadOptionsFile
Find the .buildbot/options file. Crawl from the current directory up towards the root, and also look in ~/.buildbot . The first directory that's owned by the user and has the file we're looking for wins. Windows skips the owned-by-user test. @rtype: dict @return: a dictionary o...
master/buildbot/scripts/base.py
def loadOptionsFile(self, _here=None): """Find the .buildbot/options file. Crawl from the current directory up towards the root, and also look in ~/.buildbot . The first directory that's owned by the user and has the file we're looking for wins. Windows skips the owned-by-user test. ...
def loadOptionsFile(self, _here=None): """Find the .buildbot/options file. Crawl from the current directory up towards the root, and also look in ~/.buildbot . The first directory that's owned by the user and has the file we're looking for wins. Windows skips the owned-by-user test. ...
[ "Find", "the", ".", "buildbot", "/", "options", "file", ".", "Crawl", "from", "the", "current", "directory", "up", "towards", "the", "root", "and", "also", "look", "in", "~", "/", ".", "buildbot", ".", "The", "first", "directory", "that", "s", "owned", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/scripts/base.py#L205-L264
[ "def", "loadOptionsFile", "(", "self", ",", "_here", "=", "None", ")", ":", "here", "=", "_here", "or", "os", ".", "path", ".", "abspath", "(", "os", ".", "getcwd", "(", ")", ")", "if", "runtime", ".", "platformType", "==", "'win32'", ":", "# never t...
5df3cfae6d760557d99156633c32b1822a1e130c
train
AutoLoginPBFactory.failedToGetPerspective
The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials.
worker/buildbot_worker/pbutil.py
def failedToGetPerspective(self, why, broker): """The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials. """ log.msg("ReconnectingPBClientFactory....
def failedToGetPerspective(self, why, broker): """The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials. """ log.msg("ReconnectingPBClientFactory....
[ "The", "login", "process", "failed", "most", "likely", "because", "of", "an", "authorization", "failure", "(", "bad", "password", ")", "but", "it", "is", "also", "possible", "that", "we", "lost", "the", "new", "connection", "before", "we", "managed", "to", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/pbutil.py#L84-L103
[ "def", "failedToGetPerspective", "(", "self", ",", "why", ",", "broker", ")", ":", "log", ".", "msg", "(", "\"ReconnectingPBClientFactory.failedToGetPerspective\"", ")", "# put something useful in the logs", "if", "why", ".", "check", "(", "pb", ".", "PBConnectionLost...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GitLabStatusPush.createStatus
:param project_id: Project ID from GitLab :param branch: Branch name to create the status for. :param sha: Full sha to create the status for. :param state: one of the following 'pending', 'success', 'failed' or 'cancelled'. :param target_url: Target url to associate...
master/buildbot/reporters/gitlab.py
def createStatus(self, project_id, branch, sha, state, target_url=None, description=None, context=None): """ :param project_id: Project ID from GitLab :param branch: Branch name to create the status for. :param sha: Full sha to create the status ...
def createStatus(self, project_id, branch, sha, state, target_url=None, description=None, context=None): """ :param project_id: Project ID from GitLab :param branch: Branch name to create the status for. :param sha: Full sha to create the status ...
[ ":", "param", "project_id", ":", "Project", "ID", "from", "GitLab", ":", "param", "branch", ":", "Branch", "name", "to", "create", "the", "status", "for", ".", ":", "param", "sha", ":", "Full", "sha", "to", "create", "the", "status", "for", ".", ":", ...
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gitlab.py#L63-L91
[ "def", "createStatus", "(", "self", ",", "project_id", ",", "branch", ",", "sha", ",", "state", ",", "target_url", "=", "None", ",", "description", "=", "None", ",", "context", "=", "None", ")", ":", "payload", "=", "{", "'state'", ":", "state", ",", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildRequest.fromBrdict
Construct a new L{BuildRequest} from a dictionary as returned by L{BuildRequestsConnectorComponent.getBuildRequest}. This method uses a cache, which may result in return of stale objects; for the most up-to-date information, use the database connector methods. @param master: cu...
master/buildbot/process/buildrequest.py
def fromBrdict(cls, master, brdict): """ Construct a new L{BuildRequest} from a dictionary as returned by L{BuildRequestsConnectorComponent.getBuildRequest}. This method uses a cache, which may result in return of stale objects; for the most up-to-date information, use the datab...
def fromBrdict(cls, master, brdict): """ Construct a new L{BuildRequest} from a dictionary as returned by L{BuildRequestsConnectorComponent.getBuildRequest}. This method uses a cache, which may result in return of stale objects; for the most up-to-date information, use the datab...
[ "Construct", "a", "new", "L", "{", "BuildRequest", "}", "from", "a", "dictionary", "as", "returned", "by", "L", "{", "BuildRequestsConnectorComponent", ".", "getBuildRequest", "}", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L196-L211
[ "def", "fromBrdict", "(", "cls", ",", "master", ",", "brdict", ")", ":", "cache", "=", "master", ".", "caches", ".", "get_cache", "(", "\"BuildRequests\"", ",", "cls", ".", "_make_br", ")", "return", "cache", ".", "get", "(", "brdict", "[", "'buildreques...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildRequest.canBeCollapsed
Returns true if both buildrequest can be merged, via Deferred. This implements Buildbot's default collapse strategy.
master/buildbot/process/buildrequest.py
def canBeCollapsed(master, br1, br2): """ Returns true if both buildrequest can be merged, via Deferred. This implements Buildbot's default collapse strategy. """ # short-circuit: if these are for the same buildset, collapse away if br1['buildsetid'] == br2['buildsetid']...
def canBeCollapsed(master, br1, br2): """ Returns true if both buildrequest can be merged, via Deferred. This implements Buildbot's default collapse strategy. """ # short-circuit: if these are for the same buildset, collapse away if br1['buildsetid'] == br2['buildsetid']...
[ "Returns", "true", "if", "both", "buildrequest", "can", "be", "merged", "via", "Deferred", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L253-L309
[ "def", "canBeCollapsed", "(", "master", ",", "br1", ",", "br2", ")", ":", "# short-circuit: if these are for the same buildset, collapse away", "if", "br1", "[", "'buildsetid'", "]", "==", "br2", "[", "'buildsetid'", "]", ":", "return", "True", "# get the buidlsets fo...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildRequest.mergeSourceStampsWith
Returns one merged sourcestamp for every codebase
master/buildbot/process/buildrequest.py
def mergeSourceStampsWith(self, others): """ Returns one merged sourcestamp for every codebase """ # get all codebases from all requests all_codebases = set(self.sources) for other in others: all_codebases |= set(other.sources) all_merged_sources = {} # walk ...
def mergeSourceStampsWith(self, others): """ Returns one merged sourcestamp for every codebase """ # get all codebases from all requests all_codebases = set(self.sources) for other in others: all_codebases |= set(other.sources) all_merged_sources = {} # walk ...
[ "Returns", "one", "merged", "sourcestamp", "for", "every", "codebase" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L311-L334
[ "def", "mergeSourceStampsWith", "(", "self", ",", "others", ")", ":", "# get all codebases from all requests", "all_codebases", "=", "set", "(", "self", ".", "sources", ")", "for", "other", "in", "others", ":", "all_codebases", "|=", "set", "(", "other", ".", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
BuildRequest.mergeReasons
Return a reason for the merged build request.
master/buildbot/process/buildrequest.py
def mergeReasons(self, others): """Return a reason for the merged build request.""" reasons = [] for req in [self] + others: if req.reason and req.reason not in reasons: reasons.append(req.reason) return ", ".join(reasons)
def mergeReasons(self, others): """Return a reason for the merged build request.""" reasons = [] for req in [self] + others: if req.reason and req.reason not in reasons: reasons.append(req.reason) return ", ".join(reasons)
[ "Return", "a", "reason", "for", "the", "merged", "build", "request", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L336-L342
[ "def", "mergeReasons", "(", "self", ",", "others", ")", ":", "reasons", "=", "[", "]", "for", "req", "in", "[", "self", "]", "+", "others", ":", "if", "req", ".", "reason", "and", "req", ".", "reason", "not", "in", "reasons", ":", "reasons", ".", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
bytes2NativeString
Convert C{bytes} to a native C{str}. On Python 3 and higher, str and bytes are not equivalent. In this case, decode the bytes, and return a native string. On Python 2 and lower, str and bytes are equivalent. In this case, just just return the native string. @param x: a string of type C{...
worker/buildbot_worker/compat.py
def bytes2NativeString(x, encoding='utf-8'): """ Convert C{bytes} to a native C{str}. On Python 3 and higher, str and bytes are not equivalent. In this case, decode the bytes, and return a native string. On Python 2 and lower, str and bytes are equivalent. In this case, just just ret...
def bytes2NativeString(x, encoding='utf-8'): """ Convert C{bytes} to a native C{str}. On Python 3 and higher, str and bytes are not equivalent. In this case, decode the bytes, and return a native string. On Python 2 and lower, str and bytes are equivalent. In this case, just just ret...
[ "Convert", "C", "{", "bytes", "}", "to", "a", "native", "C", "{", "str", "}", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L38-L56
[ "def", "bytes2NativeString", "(", "x", ",", "encoding", "=", "'utf-8'", ")", ":", "if", "isinstance", "(", "x", ",", "bytes", ")", "and", "str", "!=", "bytes", ":", "return", "x", ".", "decode", "(", "encoding", ")", "return", "x" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
unicode2bytes
Convert a unicode string to C{bytes}. @param x: a unicode string, of type C{unicode} on Python 2, or C{str} on Python 3. @param encoding: an optional codec, default: 'utf-8' @param errors: error handling scheme, default 'strict' @return: a string of type C{bytes}
worker/buildbot_worker/compat.py
def unicode2bytes(x, encoding='utf-8', errors='strict'): """ Convert a unicode string to C{bytes}. @param x: a unicode string, of type C{unicode} on Python 2, or C{str} on Python 3. @param encoding: an optional codec, default: 'utf-8' @param errors: error handling scheme, default 'str...
def unicode2bytes(x, encoding='utf-8', errors='strict'): """ Convert a unicode string to C{bytes}. @param x: a unicode string, of type C{unicode} on Python 2, or C{str} on Python 3. @param encoding: an optional codec, default: 'utf-8' @param errors: error handling scheme, default 'str...
[ "Convert", "a", "unicode", "string", "to", "C", "{", "bytes", "}", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L59-L71
[ "def", "unicode2bytes", "(", "x", ",", "encoding", "=", "'utf-8'", ",", "errors", "=", "'strict'", ")", ":", "if", "isinstance", "(", "x", ",", "text_type", ")", ":", "x", "=", "x", ".", "encode", "(", "encoding", ",", "errors", ")", "return", "x" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
bytes2unicode
Convert a C{bytes} to a unicode string. @param x: a unicode string, of type C{unicode} on Python 2, or C{str} on Python 3. @param encoding: an optional codec, default: 'utf-8' @param errors: error handling scheme, default 'strict' @return: a unicode string of type C{unicode} on Python 2, ...
worker/buildbot_worker/compat.py
def bytes2unicode(x, encoding='utf-8', errors='strict'): """ Convert a C{bytes} to a unicode string. @param x: a unicode string, of type C{unicode} on Python 2, or C{str} on Python 3. @param encoding: an optional codec, default: 'utf-8' @param errors: error handling scheme, default 's...
def bytes2unicode(x, encoding='utf-8', errors='strict'): """ Convert a C{bytes} to a unicode string. @param x: a unicode string, of type C{unicode} on Python 2, or C{str} on Python 3. @param encoding: an optional codec, default: 'utf-8' @param errors: error handling scheme, default 's...
[ "Convert", "a", "C", "{", "bytes", "}", "to", "a", "unicode", "string", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L74-L87
[ "def", "bytes2unicode", "(", "x", ",", "encoding", "=", "'utf-8'", ",", "errors", "=", "'strict'", ")", ":", "if", "isinstance", "(", "x", ",", "(", "text_type", ",", "type", "(", "None", ")", ")", ")", ":", "return", "x", "return", "text_type", "(",...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Mock.start
Try to remove the old mock logs first.
master/buildbot/steps/package/rpm/mock.py
def start(self): """ Try to remove the old mock logs first. """ if self.resultdir: for lname in self.mock_logfiles: self.logfiles[lname] = self.build.path_module.join(self.resultdir, lname) ...
def start(self): """ Try to remove the old mock logs first. """ if self.resultdir: for lname in self.mock_logfiles: self.logfiles[lname] = self.build.path_module.join(self.resultdir, lname) ...
[ "Try", "to", "remove", "the", "old", "mock", "logs", "first", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/package/rpm/mock.py#L87-L110
[ "def", "start", "(", "self", ")", ":", "if", "self", ".", "resultdir", ":", "for", "lname", "in", "self", ".", "mock_logfiles", ":", "self", ".", "logfiles", "[", "lname", "]", "=", "self", ".", "build", ".", "path_module", ".", "join", "(", "self", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
_handle_stream_line
\ Input is the json representation of: {'stream': "Content\ncontent"} Output is a generator yield "Content", and then "content"
master/buildbot/worker/docker.py
def _handle_stream_line(line): """\ Input is the json representation of: {'stream': "Content\ncontent"} Output is a generator yield "Content", and then "content" """ # XXX This necessary processing is probably a bug from docker-py, # hence, might break if the bug is fixed, i.e. we should get dec...
def _handle_stream_line(line): """\ Input is the json representation of: {'stream': "Content\ncontent"} Output is a generator yield "Content", and then "content" """ # XXX This necessary processing is probably a bug from docker-py, # hence, might break if the bug is fixed, i.e. we should get dec...
[ "\\", "Input", "is", "the", "json", "representation", "of", ":", "{", "stream", ":", "Content", "\\", "ncontent", "}", "Output", "is", "a", "generator", "yield", "Content", "and", "then", "content" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/worker/docker.py#L45-L60
[ "def", "_handle_stream_line", "(", "line", ")", ":", "# XXX This necessary processing is probably a bug from docker-py,", "# hence, might break if the bug is fixed, i.e. we should get decoded JSON", "# directly from the API.", "line", "=", "json", ".", "loads", "(", "line", ")", "i...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Contact.shouldReportBuild
Returns True if this build should be reported for this contact (eliminating duplicates), and also records the report for later
master/buildbot/reporters/words.py
def shouldReportBuild(self, builder, buildnum): """Returns True if this build should be reported for this contact (eliminating duplicates), and also records the report for later""" for w, b, n in self.reported_builds: if b == builder and n == buildnum: return False ...
def shouldReportBuild(self, builder, buildnum): """Returns True if this build should be reported for this contact (eliminating duplicates), and also records the report for later""" for w, b, n in self.reported_builds: if b == builder and n == buildnum: return False ...
[ "Returns", "True", "if", "this", "build", "should", "be", "reported", "for", "this", "contact", "(", "eliminating", "duplicates", ")", "and", "also", "records", "the", "report", "for", "later" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/words.py#L249-L263
[ "def", "shouldReportBuild", "(", "self", ",", "builder", ",", "buildnum", ")", ":", "for", "w", ",", "b", ",", "n", "in", "self", ".", "reported_builds", ":", "if", "b", "==", "builder", "and", "n", "==", "buildnum", ":", "return", "False", "self", "...
5df3cfae6d760557d99156633c32b1822a1e130c
train
Contact.splitArgs
Returns list of arguments parsed by shlex.split() or raise UsageError if failed
master/buildbot/reporters/words.py
def splitArgs(self, args): """Returns list of arguments parsed by shlex.split() or raise UsageError if failed""" try: return shlex.split(args) except ValueError as e: raise UsageError(e)
def splitArgs(self, args): """Returns list of arguments parsed by shlex.split() or raise UsageError if failed""" try: return shlex.split(args) except ValueError as e: raise UsageError(e)
[ "Returns", "list", "of", "arguments", "parsed", "by", "shlex", ".", "split", "()", "or", "raise", "UsageError", "if", "failed" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/words.py#L265-L271
[ "def", "splitArgs", "(", "self", ",", "args", ")", ":", "try", ":", "return", "shlex", ".", "split", "(", "args", ")", "except", "ValueError", "as", "e", ":", "raise", "UsageError", "(", "e", ")" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
StatusBot.getContact
get a Contact instance for ``user`` on ``channel``
master/buildbot/reporters/words.py
def getContact(self, user=None, channel=None): """ get a Contact instance for ``user`` on ``channel`` """ try: return self.contacts[(channel, user)] except KeyError: new_contact = self.contactClass(self, user=user, channel=channel) self.contacts[(channel, user...
def getContact(self, user=None, channel=None): """ get a Contact instance for ``user`` on ``channel`` """ try: return self.contacts[(channel, user)] except KeyError: new_contact = self.contactClass(self, user=user, channel=channel) self.contacts[(channel, user...
[ "get", "a", "Contact", "instance", "for", "user", "on", "channel" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/words.py#L1032-L1040
[ "def", "getContact", "(", "self", ",", "user", "=", "None", ",", "channel", "=", "None", ")", ":", "try", ":", "return", "self", ".", "contacts", "[", "(", "channel", ",", "user", ")", "]", "except", "KeyError", ":", "new_contact", "=", "self", ".", ...
5df3cfae6d760557d99156633c32b1822a1e130c
train
SubunitLogObserver.issue
An issue - failing, erroring etc test.
master/buildbot/steps/subunit.py
def issue(self, test, err): """An issue - failing, erroring etc test.""" self.step.setProgress('tests failed', len(self.failures) + len(self.errors))
def issue(self, test, err): """An issue - failing, erroring etc test.""" self.step.setProgress('tests failed', len(self.failures) + len(self.errors))
[ "An", "issue", "-", "failing", "erroring", "etc", "test", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/subunit.py#L79-L82
[ "def", "issue", "(", "self", ",", "test", ",", "err", ")", ":", "self", ".", "step", ".", "setProgress", "(", "'tests failed'", ",", "len", "(", "self", ".", "failures", ")", "+", "len", "(", "self", ".", "errors", ")", ")" ]
5df3cfae6d760557d99156633c32b1822a1e130c
train
GitLabHandler._process_change
Consumes the JSON as a python object and actually starts the build. :arguments: payload Python Object that represents the JSON sent by GitLab Service Hook.
master/buildbot/www/hooks/gitlab.py
def _process_change(self, payload, user, repo, repo_url, event, codebase=None): """ Consumes the JSON as a python object and actually starts the build. :arguments: payload Python Object that represents the JSON sent by GitLab Service ...
def _process_change(self, payload, user, repo, repo_url, event, codebase=None): """ Consumes the JSON as a python object and actually starts the build. :arguments: payload Python Object that represents the JSON sent by GitLab Service ...
[ "Consumes", "the", "JSON", "as", "a", "python", "object", "and", "actually", "starts", "the", "build", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/gitlab.py#L35-L97
[ "def", "_process_change", "(", "self", ",", "payload", ",", "user", ",", "repo", ",", "repo_url", ",", "event", ",", "codebase", "=", "None", ")", ":", "changes", "=", "[", "]", "refname", "=", "payload", "[", "'ref'", "]", "# project name from http header...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GitLabHandler._process_merge_request_change
Consumes the merge_request JSON as a python object and turn it into a buildbot change. :arguments: payload Python Object that represents the JSON sent by GitLab Service Hook.
master/buildbot/www/hooks/gitlab.py
def _process_merge_request_change(self, payload, event, codebase=None): """ Consumes the merge_request JSON as a python object and turn it into a buildbot change. :arguments: payload Python Object that represents the JSON sent by GitLab Service Hook. ...
def _process_merge_request_change(self, payload, event, codebase=None): """ Consumes the merge_request JSON as a python object and turn it into a buildbot change. :arguments: payload Python Object that represents the JSON sent by GitLab Service Hook. ...
[ "Consumes", "the", "merge_request", "JSON", "as", "a", "python", "object", "and", "turn", "it", "into", "a", "buildbot", "change", "." ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/gitlab.py#L99-L154
[ "def", "_process_merge_request_change", "(", "self", ",", "payload", ",", "event", ",", "codebase", "=", "None", ")", ":", "attrs", "=", "payload", "[", "'object_attributes'", "]", "commit", "=", "attrs", "[", "'last_commit'", "]", "when_timestamp", "=", "date...
5df3cfae6d760557d99156633c32b1822a1e130c
train
GitLabHandler.getChanges
Reponds only to POST events and starts the build process :arguments: request the http request object
master/buildbot/www/hooks/gitlab.py
def getChanges(self, request): """ Reponds only to POST events and starts the build process :arguments: request the http request object """ expected_secret = isinstance(self.options, dict) and self.options.get('secret') if expected_secret: ...
def getChanges(self, request): """ Reponds only to POST events and starts the build process :arguments: request the http request object """ expected_secret = isinstance(self.options, dict) and self.options.get('secret') if expected_secret: ...
[ "Reponds", "only", "to", "POST", "events", "and", "starts", "the", "build", "process" ]
buildbot/buildbot
python
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/gitlab.py#L157-L202
[ "def", "getChanges", "(", "self", ",", "request", ")", ":", "expected_secret", "=", "isinstance", "(", "self", ".", "options", ",", "dict", ")", "and", "self", ".", "options", ".", "get", "(", "'secret'", ")", "if", "expected_secret", ":", "received_secret...
5df3cfae6d760557d99156633c32b1822a1e130c