Fix indentation of block
authorHugh Brown <hbrown@amplify.com>
Thu, 10 Oct 2013 20:08:46 +0000 (16:08 -0400)
committerHugh Brown <hbrown@amplify.com>
Thu, 10 Oct 2013 20:36:40 +0000 (16:36 -0400)
jenkinsapi/artifact.py
jenkinsapi/build.py
jenkinsapi/jenkins.py
jenkinsapi/job.py
jenkinsapi/queue.py

index 3ed7d9c..e4cccab 100644 (file)
@@ -112,6 +112,4 @@ class Artifact(object):
         """
         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)
index 6bcfae7..4e9c7d3 100644 (file)
@@ -56,8 +56,11 @@ class Build(JenkinsBase):
     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
index 58c5d49..877def2 100644 (file)
@@ -134,8 +134,8 @@ class Jenkins(JenkinsBase):
         :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(),
index 0a7ccc2..548de72 100644 (file)
@@ -228,8 +228,7 @@ class Job(JenkinsBase, MutableJenkinsThing):
         # 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):
         """
index 43d2aa1..308a526 100644 (file)
@@ -51,7 +51,7 @@ class Queue(JenkinsBase):
             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)
@@ -78,10 +78,7 @@ class QueueItem(object):
         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)