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') )