~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:55:30 UTC
  • Revision ID: grantw@unimelb.edu.au-20100224095530-1jp20s0f6c8xbgr8
Shuffle deep view code to make a bit more sense.

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
 
281
281
                if view is not None:
282
282
                    return (obj, view, tuple(todo[remove:]))
 
283
                # We have just one segment, but no view was found. Try
 
284
                # appending the default view name.
 
285
                elif len(todo) == 1:
 
286
                    # Augment it with the default view name, and look it up.
 
287
                    view = vnames.get((todo[0], self.default))
 
288
                    if view is not None:
 
289
                        return (obj, view, tuple(todo[2:]))
283
290
                # Now we must check for deep views.
284
291
                # A deep view is one that has a name consisting of
285
292
                # multiple segments. It's messier than it could be, because
293
300
                    view = vnames.get(tuple(todo + [self.default]))
294
301
                    if view is not None:
295
302
                        return (obj, view, tuple())
296
 
                # We have just one segment, but no view was found. Try
297
 
                # adding the default view.
298
 
                elif len(todo) == 1:
299
 
                    # Augment it with the default view name, and look it up.
300
 
                    view = vnames.get((todo[0], self.default))
301
 
                    if view is not None:
302
 
                        return (obj, view, tuple(todo[2:]))
303
303
 
304
304
            # If there are no segments left to use, or there are no routes, we
305
305
            # get out.