====
URLs
====

>>> from gocept.lms.url import URLContainer, URL
>>> provider = URLContainer()
>>> provider.add('http://example.com/')
<gocept.lms.url.URL 'http://example.com/'>

>>> provider.get_url('http://example.com/')
<gocept.lms.url.URL 'http://example.com/'>

>>> provider.get_url('http://example.org/') is None
True

We use a URL-safe base64 encoding. The following string produces a non-URL
safe string when using the standard base64 encoding:

>>> url = provider.add('http://muse.bio.cornell.edu/cgi-bin/hl?bird')
>>> url.__name__
u'aHR0cDovL211c2UuYmlvLmNvcm5lbGwuZWR1L2NnaS1iaW4vaGw_YmlyZA=='

URLs can be grouped into classes which express a proximity in the sense that
loading them will use similar resources such as hosts:
