Skip to content

Commit

Permalink
fix pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
djay committed Sep 15, 2013
1 parent 29fe3fd commit 8ceb9b9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plone/app/widgets/browser.py
Expand Up @@ -171,7 +171,8 @@ def __call__(self):
factory_spec.args[3] == 'batch':
supports_batch = True
if (not supports_query and query):
raise KeyError("The vocabulary factory %s does not support query arguments", factory)
raise KeyError("The vocabulary factory %s does not support query arguments",
factory)
if batch and supports_batch:
vocabulary = factory(self.context, query, batch)
elif query:
Expand All @@ -186,12 +187,14 @@ def __call__(self):
total = len(vocabulary)
except TypeError:
total = 0 # do not error if object does not support __len__
# we'll check again later if we can figure some size out
# we'll check again later if we can figure some size
# out
if batch and ('size' not in batch or 'page' not in batch):
batch = None # batching not providing correct options
logger.error("A vocabulary request contained bad batch information."
"The batch information is ignored.")
if batch and not supports_batch and ISlicableVocabulary.providedBy(vocabulary):
logger.error("A vocabulary request contained bad batch "
"information. The batch information is ignored.")
if batch and not supports_batch and \
ISlicableVocabulary.providedBy(vocabulary):
# must be slicable for batching support
page = int(batch['page'])
# page is being passed in is 1-based
Expand Down

1 comment on commit 8ceb9b9

@mister-roboto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing information:

Please sign in to comment.