~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/publisher/__init__.py

  • Committer: William Grant
  • Date: 2010-02-24 09:51:04 UTC
  • Revision ID: grantw@unimelb.edu.au-20100224095104-nl3ndy0cysz2ioad
Add support for "really deep" (more than two segment) views.

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
                # we also allow omission of the final segment if it is the
287
287
                # default view name.
288
288
                elif len(todo) >= 2:
289
 
                    view = vnames.get(tuple(todo[:2]))
 
289
                    for x in range(2, len(todo) + 1):
 
290
                        view = vnames.get(tuple(todo[:x]))
 
291
                        if view is not None:
 
292
                            return (obj, view, tuple(todo[x:]))
 
293
                    view = vnames.get(tuple(todo + [self.default]))
290
294
                    if view is not None:
291
 
                        return (obj, view, tuple(todo[2:]))
 
295
                        return (obj, view, tuple())
 
296
                # We have just one segment, but no view was found. Try
 
297
                # adding the default view.
292
298
                elif len(todo) == 1:
293
299
                    # Augment it with the default view name, and look it up.
294
300
                    view = vnames.get((todo[0], self.default))