Skip to content

Commit

Permalink
Remove use of ''.format, as it is not well-supported in 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Dec 11, 2014
1 parent 367acfd commit 0b422fa
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/buildslave/docker.py
Expand Up @@ -74,7 +74,7 @@ def __init__(self, name, password, docker_host, image=None, command=None,
volume, bind = volume_string.split(":", 1)
except ValueError:
config.error("Invalid volume definition for docker "
"{0}. Skipping...".format(volume_string))
"%s. Skipping..." % volume_string)
self.volumes.append(volume)

ro = False
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/buildslave/ec2.py
Expand Up @@ -150,7 +150,7 @@ def __init__(self, name, password, instance_type, ami=None,
aws_secret_access_key=secret_identifier)
else:
raise ValueError(
'The specified region does not exist: {0}'.format(region))
'The specified region does not exist: ' + region)

else:
self.conn = boto.connect_ec2(identifier, secret_identifier)
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/changes/gerritchangesource.py
Expand Up @@ -51,7 +51,7 @@ def _gerrit_user_to_author(props, username=u"unknown"):
username = props.get("username", username)
username = props.get("name", username)
if "email" in props:
username += u" <{email}>".format(**props)
username += u" <%(email)s>" % props
return username


Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/config.py
Expand Up @@ -593,8 +593,8 @@ def load_services(self, filename, config_dict):
self.services = {}
for _service in config_dict['services']:
if not isinstance(_service, util_service.BuildbotService):
error("{0} object should be an instance of "
"buildbot.util.service.BuildbotService".format(type(_service)))
error("%s object should be an instance of "
"buildbot.util.service.BuildbotService" % type(_service))

continue

Expand Down
9 changes: 6 additions & 3 deletions master/buildbot/process/buildstep.py
Expand Up @@ -375,15 +375,18 @@ def updateSummary(self):
def methodInfo(m):
import inspect
lines = inspect.getsourcelines(m)
return "\nat {0}:{1}:\n {2}".format(inspect.getsourcefile(m), lines[1], "\n".join(lines[0]))
return "\nat %s:%s:\n %s" % (
inspect.getsourcefile(m), lines[1], "\n".join(lines[0]))
if not self._running:
summary = yield self.getResultSummary()
if not isinstance(summary, dict):
raise TypeError('getResultSummary must return a dictionary: ' + methodInfo(self.getCurrentSummary))
raise TypeError('getResultSummary must return a dictionary: '
+ methodInfo(self.getCurrentSummary))
else:
summary = yield self.getCurrentSummary()
if not isinstance(summary, dict):
raise TypeError('getCurrentSummary must return a dictionary: ' + methodInfo(self.getCurrentSummary))
raise TypeError('getCurrentSummary must return a dictionary: '
+ methodInfo(self.getCurrentSummary))

stepResult = summary.get('step', u'finished')
if not isinstance(stepResult, unicode):
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/util/service.py
Expand Up @@ -238,7 +238,7 @@ def __init__(self, *args, **kwargs):
if name is not None:
self.name = name
if self.name is None:
raise ValueError("{0}: must pass a name to constructor".format(type(self)))
raise ValueError("%s: must pass a name to constructor" % type(self))
self.checkConfig(*args, **kwargs)
self._config_args = args
self._config_kwargs = kwargs
Expand Down
6 changes: 4 additions & 2 deletions master/buildbot/www/plugin.py
Expand Up @@ -19,12 +19,14 @@


class Application(object):

def __init__(self, modulename, description):
self.description = description
self.version = pkg_resources.resource_string(modulename, "/VERSION").strip()
self.static_dir = pkg_resources.resource_filename(modulename, "/static")
self.resource = static.File(self.static_dir)

def __repr__(self):
return "www.plugin.Application(version={version}, description={description}, static_dir={static_dir})".format(
**self.__dict__)
return ("www.plugin.Application(version=%(version)s, "
"description=%(description)s, "
"static_dir=%(static_dir)s)") % self.__dict__
Expand Up @@ -22,4 +22,4 @@ class Durationformat extends Filter('common')
class Dateformat extends Filter('common')
constructor: (MOMENT) ->
return (time, f) ->
return MOMENT.unix(time).format(f)
return MOMENT.unix(time).format(f)

0 comments on commit 0b422fa

Please sign in to comment.