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 3ed7d9c852a85cc34b4c629ac425a2c6100a7aa9..e4cccabae3205f985a56016665944c9e14c07ca0 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 6bcfae72405a13423a672b0af199c4bc7e12551d..4e9c7d3b21c36bea8c4a8d0096fc9b03a272a081 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 58c5d492a6611b93b81fcf30bd0f4996fdff5cfd..877def26428c987f25ee0319011c0645be3426d4 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 0a7ccc249265081f49c4b9c91642939b07caf69d..548de72c39cc39e7acdb55bbf0fd5043f9f5ba9f 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 43d2aa18ad2bfab35e6e673066cd43eafc32b8f9..308a52609bef67b33162e398d5e40e268f878ece 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)