Fixed pylint violations
authorAleksey Maksimov <ctpeko3a@gmail.com>
Sat, 29 Mar 2014 16:51:12 +0000 (00:51 +0800)
committerAleksey Maksimov <ctpeko3a@gmail.com>
Sat, 29 Mar 2014 16:51:12 +0000 (00:51 +0800)
jenkinsapi/api.py
jenkinsapi/build.py
jenkinsapi/jenkins.py
jenkinsapi/node.py
jenkinsapi/plugins.py
jenkinsapi/view.py
jenkinsapi/views.py

index 948f4de822ec705b068d5397dfbcf71f086e43ff..544444248eb981eb460225470064d3afad0454a8 100644 (file)
@@ -97,7 +97,7 @@ def search_artifacts(jenkinsurl, jobid, artifact_ids=None,
         missing_artifacts = set(artifact_ids) - set(artifacts.keys())
         log.debug(msg="Artifacts %s missing from %s #%i"
                   % (", ".join(missing_artifacts), jobid, build_id))
-    #noinspection PyUnboundLocalVariable
+    # noinspection PyUnboundLocalVariable
     raise ArtifactsMissing(missing_artifacts)
 
 
@@ -136,7 +136,7 @@ def block_until_complete(jenkinsurl, jobs, maxwait=12000, interval=30,
                  % (str_still_running, time_left))
         time.sleep(interval)
     if raise_on_timeout:
-        #noinspection PyUnboundLocalVariable
+        # noinspection PyUnboundLocalVariable
         raise TimeOut("Waited too long for these jobs to complete: %s"
                       % str_still_running)
 
index 7405c28fb065dda0cf65cbf53061a0aea46c99b8..d150cc5df55cdabeec1bb3dc5faa1cdf25f9aae5 100644 (file)
@@ -40,8 +40,8 @@ class Build(JenkinsBase):
         JenkinsBase.__init__(self, url)
 
     def _poll(self):
-        #For build's we need more information for downstream and upstream builds
-        #so we override the poll to get at the extra data for build objects
+        # For build's we need more information for downstream and upstream builds
+        # so we override the poll to get at the extra data for build objects
         url = self.python_api_url(self.baseurl) + '?depth=1'
         return self.get_data(url)
 
index 823db74bd9fa6b6bb0b3188f5656307df39c3b14..1d4b2a708d000953acea9fbff817586a85d01859 100644 (file)
@@ -197,7 +197,7 @@ class Jenkins(JenkinsBase):
         return Views(self)
 
     def get_view_by_url(self, str_view_url):
-        #for nested view
+        # for nested view
         str_view_name = str_view_url.split('/view/')[-1].replace('/', '')
         return View(str_view_url, str_view_name, jenkins_obj=self)
 
index 8c5a6da1a425fe23ae23ed23ca46ab9c6271def1..78a4afbcde4d44ba1a54ff864c565a0af21ff8a9 100644 (file)
@@ -59,7 +59,7 @@ class Node(JenkinsBase):
             raise AssertionError("Node is offline and not marked as temporarilyOffline" +
                                  ", check client connection: " +
                                  "offline = %s , temporarilyOffline = %s" %
-                                (self._data['offline'], self._data['temporarilyOffline']))
+                                 (self._data['offline'], self._data['temporarilyOffline']))
         elif self._data['offline'] and self._data['temporarilyOffline']:
             self.toggle_temporarily_offline()
             if self._data['offline']:
index ea38b5d31a5ea0a08fd951f8ee01f4d934ee4a13..1cd2ca26a24e93bf868054ed9ccbca6e077cd718 100644 (file)
@@ -36,9 +36,7 @@ class Plugins(JenkinsBase):
         return [a[1] for a in self.iteritems()]
 
     def _get_plugins(self):
-        if not 'plugins' in self._data:
-            pass
-        else:
+        if 'plugins' in self._data:
             for p_dict in self._data["plugins"]:
                 yield p_dict["shortName"], Plugin(p_dict)
 
index 33718009dad6e1a1a4ba2127e171cf8a4c7fede3..f8bf5db9495d89212d5a384832b9e0f38f9afb8c 100644 (file)
@@ -60,9 +60,7 @@ class View(JenkinsBase):
         return [a for a in self.iteritems()]
 
     def _get_jobs(self):
-        if not 'jobs' in self._data:
-            pass
-        else:
+        if 'jobs' in self._data:
             for viewdict in self._data["jobs"]:
                 yield viewdict["name"], viewdict["url"]
 
@@ -77,7 +75,7 @@ class View(JenkinsBase):
             job_dict = self.get_job_dict()
             return job_dict[str_job_name]
         except KeyError:
-            #noinspection PyUnboundLocalVariable
+            # noinspection PyUnboundLocalVariable
             all_views = ", ".join(job_dict.keys())
             raise KeyError("Job %s is not known - available: %s" % (str_job_name, all_views))
 
index 2af052be22abd676b60b289a0304a817a3058634..bac9b70abb087ef986fcebd36b9319db6ee43296 100644 (file)
@@ -86,7 +86,6 @@ class Views(object):
         :return: new View obj or None if view was not created
         """
         log.info(msg='Creating "%s" view "%s"' % (view_type, view_name))
-        #url = urlparse.urljoin(self.baseurl, "user/%s/my-views/" % person) if person else self.baseurl
 
         if view_name in self:
             log.warn(msg='View "%s" already exists' % view_name)