|
@@ -32,6 +32,21 @@ class Resource: |
|
|
|
|
|
|
|
|
return root |
|
|
return root |
|
|
|
|
|
|
|
|
|
|
|
class ResourceList(list): |
|
|
|
|
|
'''Special class to not overwrite mimetypes that already exist.''' |
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
self._mt = {} |
|
|
|
|
|
list.__init__(self, *args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
def append(self, k): |
|
|
|
|
|
assert isinstance(k, Resource) |
|
|
|
|
|
mt = k.protocolInfo.split(':')[2] |
|
|
|
|
|
if self._mt.has_key(mt): |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
list.append(self, k) |
|
|
|
|
|
self._mt[mt] = k |
|
|
|
|
|
|
|
|
class Object(object): |
|
|
class Object(object): |
|
|
"""The root class of the entire content directory class heirachy.""" |
|
|
"""The root class of the entire content directory class heirachy.""" |
|
|
|
|
|
|
|
|