From 59464dd081e37aa44456d1277baa5f01b00f1586 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 15 Sep 2015 13:47:37 -0400 Subject: [PATCH] Fix the pep8 issues The stackviz repo was recently moved into gerrit and the standard python jobs were added on it. However there were some outstanding pep8 issue on the repo which is blocking any changes. This commit fixes all of them. Change-Id: I2d40ee965ba3166a580f16046fc741e05b54ac74 --- stackviz/parser/tempest_subunit.py | 15 +++++++-------- stackviz/views/upstream/api.py | 4 +++- stackviz/views/upstream/urls.py | 3 ++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/stackviz/parser/tempest_subunit.py b/stackviz/parser/tempest_subunit.py index 3cffe8a..a825d62 100644 --- a/stackviz/parser/tempest_subunit.py +++ b/stackviz/parser/tempest_subunit.py @@ -46,10 +46,11 @@ class InvalidSubunitProvider(Exception): class SubunitProvider(object): @property def name(self): - """Returns a unique name for this provider, such that a valid URL - fragment pointing to a particular stream from this provider is - `name_index`, applicable for paths to pages and data files making use - of the stream. + """Returns a unique name for this provider, + + The unique name is such that a valid URL fragment pointing to a + particular stream from this provider is `name_index`, applicable + for paths to pages and data files making use of the stream. :return: a path fragment referring to the stream at `index` from this provider @@ -72,8 +73,7 @@ class SubunitProvider(object): raise NotImplementedError() def get_stream(self, index): - """Returns a file-like object representing the subunit stream at the - given index. + """Returns a file-like object representing the subunit stream :param index: the index of the stream; must be between `0` and `count - 1` (inclusive) @@ -87,8 +87,7 @@ class SubunitProvider(object): @property def streams(self): - """Creates a generator that iterates over each stream available in - this provider. + """Creates a generator to iterate over every stream in the provider :return: each stream available from this generator """ diff --git a/stackviz/views/upstream/api.py b/stackviz/views/upstream/api.py index ed5efc4..66e2ce7 100644 --- a/stackviz/views/upstream/api.py +++ b/stackviz/views/upstream/api.py @@ -44,6 +44,7 @@ def _get_runs(change_id): return ret_list + def _get_metadata(run_id): """Returns a dict of run_metadata objects associated with a run_id @@ -56,7 +57,7 @@ def _get_metadata(run_id): Session = sessionmaker(bind=engine) session = Session() - metadata = api.get_run_metadata(run_id,session=session) + metadata = api.get_run_metadata(run_id, session=session) ret_list = [] for meta in metadata: @@ -70,6 +71,7 @@ class GerritURLEndpoint(Endpoint): def get(self, request, change_id): return _get_runs(change_id) + class RunMetadataEndpoint(Endpoint): def get(self, request, run_id): diff --git a/stackviz/views/upstream/urls.py b/stackviz/views/upstream/urls.py index 3320a30..9804de3 100644 --- a/stackviz/views/upstream/urls.py +++ b/stackviz/views/upstream/urls.py @@ -34,7 +34,8 @@ urlpatterns = patterns('', GerritURLEndpoint.as_view(), name='gerrit_url'), - url(r'^api_run_id_(?P[a-zA-Z0-9!$* \t\r\n\-]+).json$', + url(r'^api_run_id_(?P[a-zA-Z0-9!$* ' + '\t\r\n\-]+).json$', RunMetadataEndpoint.as_view(), name='run_metadata_url') )