diff options
author | Aleksey Maksimov <ctpeko3a@gmail.com> | 2014-03-30 00:51:12 +0800 |
---|---|---|
committer | Aleksey Maksimov <ctpeko3a@gmail.com> | 2014-03-30 00:51:12 +0800 |
commit | 91d4f07c195f1e3912736bea5a1cccd9a1eaf3af (patch) | |
tree | 46b0d3b6feb8cbbf1722a5f36f2b1f2e250d9b81 | |
parent | 64495202e3796dc422943f2c8f67524480450457 (diff) | |
download | python-jenkinsapi-91d4f07c195f1e3912736bea5a1cccd9a1eaf3af.tar.gz python-jenkinsapi-91d4f07c195f1e3912736bea5a1cccd9a1eaf3af.tar.bz2 python-jenkinsapi-91d4f07c195f1e3912736bea5a1cccd9a1eaf3af.zip |
Fixed pylint violations
-rw-r--r-- | jenkinsapi/api.py | 4 | ||||
-rw-r--r-- | jenkinsapi/build.py | 4 | ||||
-rw-r--r-- | jenkinsapi/jenkins.py | 2 | ||||
-rw-r--r-- | jenkinsapi/node.py | 2 | ||||
-rw-r--r-- | jenkinsapi/plugins.py | 4 | ||||
-rw-r--r-- | jenkinsapi/view.py | 6 | ||||
-rw-r--r-- | jenkinsapi/views.py | 1 |
7 files changed, 9 insertions, 14 deletions
diff --git a/jenkinsapi/api.py b/jenkinsapi/api.py index 948f4de..5444442 100644 --- a/jenkinsapi/api.py +++ b/jenkinsapi/api.py @@ -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) diff --git a/jenkinsapi/build.py b/jenkinsapi/build.py index 7405c28..d150cc5 100644 --- a/jenkinsapi/build.py +++ b/jenkinsapi/build.py @@ -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) diff --git a/jenkinsapi/jenkins.py b/jenkinsapi/jenkins.py index 823db74..1d4b2a7 100644 --- a/jenkinsapi/jenkins.py +++ b/jenkinsapi/jenkins.py @@ -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) diff --git a/jenkinsapi/node.py b/jenkinsapi/node.py index 8c5a6da..78a4afb 100644 --- a/jenkinsapi/node.py +++ b/jenkinsapi/node.py @@ -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']: diff --git a/jenkinsapi/plugins.py b/jenkinsapi/plugins.py index ea38b5d..1cd2ca2 100644 --- a/jenkinsapi/plugins.py +++ b/jenkinsapi/plugins.py @@ -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) diff --git a/jenkinsapi/view.py b/jenkinsapi/view.py index 3371800..f8bf5db 100644 --- a/jenkinsapi/view.py +++ b/jenkinsapi/view.py @@ -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)) diff --git a/jenkinsapi/views.py b/jenkinsapi/views.py index 2af052b..bac9b70 100644 --- a/jenkinsapi/views.py +++ b/jenkinsapi/views.py @@ -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) |