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

« back to all changes in this revision

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

Merge from object-publishing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 
18
 
"""Object traversal URL utilities."""
 
18
"""Object publishing URL utilities."""
19
19
 
20
20
import os.path
21
21
 
22
22
ROOT = object() # Marker object for the root.
23
23
INF = object()
24
24
 
25
 
class RoutingError(Exception):
 
25
class PublishingError(Exception):
26
26
    pass
27
27
 
28
 
class NotFound(RoutingError):
 
28
class NotFound(PublishingError):
29
29
    """The path did not resolve to an object."""
30
30
    pass
31
31
 
33
33
    """The path led to a route that expected more arguments."""
34
34
    pass
35
35
 
36
 
class NoPath(RoutingError):
 
36
class NoPath(PublishingError):
37
37
    """There is no path from the given object to the root."""
38
38
    pass
39
39
 
40
 
class RouteConflict(RoutingError):
 
40
class RouteConflict(PublishingError):
41
41
    """A route with the same discriminator is already registered."""
42
42
    pass
43
43
 
61
61
        segments.pop()
62
62
    return segments
63
63
 
64
 
class Router(object):
65
 
    '''Router to resolve and generate paths.
 
64
class Publisher(object):
 
65
    '''Publisher to resolve and generate paths.
66
66
 
67
67
    Maintains a registry of forward and reverse routes, dealing with paths
68
68
    to objects and views published in the URL space.