"""
Produce a handy repr-string.
"""
- return """<%s.%s %s>""" % (self.__class__.__module__,
- self.__class__.__name__,
- self.url)
+ return """<%s.%s %s>""" % (self.__class__.__module__, self.__class__.__name__, self.url)
def _get_git_rev(self):
# Sometimes we have None as part of actions. Filter those actions
# which have lastBuiltRevision in them
- _actions = [x for x in self._data['actions'] if x \
- and "lastBuiltRevision" in x]
+ _actions = [x for x in self._data['actions']
+ if x and "lastBuiltRevision" in x]
+ # FIXME So this code returns the first item found in the filtered
+ # list. Why not just:
+ # `return _actions[0]["lastBuiltRevision"]["SHA1"]`
for item in _actions:
revision = item["lastBuiltRevision"]["SHA1"]
return revision
:return: new Job obj
"""
params = {'name': newjobname,
- 'mode': 'copy',
- 'from': jobname}
+ 'mode': 'copy',
+ 'from': jobname}
self.requester.post_and_confirm_status(
self.get_create_url(),
# FIXME SO how is this supposed to work if build is false-y?
# I don't think that builds *can* be false here, so I don't
# understand the test above.
- return dict((build["number"], build["url"])
- for build in builds)
+ return dict((build["number"], build["url"]) for build in builds)
def get_revision_dict(self):
"""
return [QueueItem(**item) for item in self._data['items']]
else:
return [QueueItem(**item) for item in self._data['items']
- if item['task']['name'] == job_name]
+ if item['task']['name'] == job_name]
def delete_item(self, queue_item):
self.delete_item_by_id(queue_item.id)
return self.jenkins[self.task['name']]
def __repr__(self):
- return "<%s.%s %s>" % (
- self.__class__.__module__,
- self.__class__.__name__,
- str(self))
+ return "<%s.%s %s>" % (self.__class__.__module__, self.__class__.__name__, str(self))
def __str__(self):
return "%s #%i" % (self.task['name'], self.id)