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
This commit is contained in:
Matthew Treinish 2015-09-15 13:47:37 -04:00
parent d28ab9cc5d
commit 59464dd081
3 changed files with 12 additions and 10 deletions

View File

@ -46,10 +46,11 @@ class InvalidSubunitProvider(Exception):
class SubunitProvider(object): class SubunitProvider(object):
@property @property
def name(self): def name(self):
"""Returns a unique name for this provider, such that a valid URL """Returns a unique name for this provider,
fragment pointing to a particular stream from this provider is
`name_index`, applicable for paths to pages and data files making use The unique name is such that a valid URL fragment pointing to a
of the stream. 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 :return: a path fragment referring to the stream at `index` from this
provider provider
@ -72,8 +73,7 @@ class SubunitProvider(object):
raise NotImplementedError() raise NotImplementedError()
def get_stream(self, index): def get_stream(self, index):
"""Returns a file-like object representing the subunit stream at the """Returns a file-like object representing the subunit stream
given index.
:param index: the index of the stream; must be between `0` and :param index: the index of the stream; must be between `0` and
`count - 1` (inclusive) `count - 1` (inclusive)
@ -87,8 +87,7 @@ class SubunitProvider(object):
@property @property
def streams(self): def streams(self):
"""Creates a generator that iterates over each stream available in """Creates a generator to iterate over every stream in the provider
this provider.
:return: each stream available from this generator :return: each stream available from this generator
""" """

View File

@ -44,6 +44,7 @@ def _get_runs(change_id):
return ret_list return ret_list
def _get_metadata(run_id): def _get_metadata(run_id):
"""Returns a dict of run_metadata objects associated with a 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 = sessionmaker(bind=engine)
session = Session() session = Session()
metadata = api.get_run_metadata(run_id,session=session) metadata = api.get_run_metadata(run_id, session=session)
ret_list = [] ret_list = []
for meta in metadata: for meta in metadata:
@ -70,6 +71,7 @@ class GerritURLEndpoint(Endpoint):
def get(self, request, change_id): def get(self, request, change_id):
return _get_runs(change_id) return _get_runs(change_id)
class RunMetadataEndpoint(Endpoint): class RunMetadataEndpoint(Endpoint):
def get(self, request, run_id): def get(self, request, run_id):

View File

@ -34,7 +34,8 @@ urlpatterns = patterns('',
GerritURLEndpoint.as_view(), GerritURLEndpoint.as_view(),
name='gerrit_url'), name='gerrit_url'),
url(r'^api_run_id_(?P<run_id>[a-zA-Z0-9!$* \t\r\n\-]+).json$', url(r'^api_run_id_(?P<run_id>[a-zA-Z0-9!$* '
'\t\r\n\-]+).json$',
RunMetadataEndpoint.as_view(), RunMetadataEndpoint.as_view(),
name='run_metadata_url') name='run_metadata_url')
) )