Remove at_once
This commit is contained in:
parent
a3c32ee77f
commit
69ec2891fa
@ -262,12 +262,6 @@ class BaseCollection:
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def at_once(self):
|
|
||||||
"""Set a context manager buffering the reads and writes."""
|
|
||||||
# TODO: use in code
|
|
||||||
yield
|
|
||||||
|
|
||||||
def get_meta(self, key):
|
def get_meta(self, key):
|
||||||
"""Get metadata value for collection."""
|
"""Get metadata value for collection."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
@ -474,11 +468,6 @@ class Collection(BaseCollection):
|
|||||||
"Can't tranlate name safely to filesystem, "
|
"Can't tranlate name safely to filesystem, "
|
||||||
"skipping component: %s", href)
|
"skipping component: %s", href)
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def at_once(self):
|
|
||||||
# TODO: use a file locker
|
|
||||||
yield
|
|
||||||
|
|
||||||
def get_meta(self, key):
|
def get_meta(self, key):
|
||||||
props_path = self._filesystem_path + ".props"
|
props_path = self._filesystem_path + ".props"
|
||||||
if os.path.exists(props_path):
|
if os.path.exists(props_path):
|
||||||
|
@ -438,7 +438,11 @@ def _propfind_response(path, item, props, user, write=False):
|
|||||||
element.append(supported)
|
element.append(supported)
|
||||||
elif is_collection:
|
elif is_collection:
|
||||||
if tag == _tag("D", "getcontenttype"):
|
if tag == _tag("D", "getcontenttype"):
|
||||||
element.text = storage.MIMETYPES[item.get_meta("tag")]
|
item_tag = item.get_meta("tag")
|
||||||
|
if item_tag:
|
||||||
|
element.text = storage.MIMETYPES[item_tag]
|
||||||
|
else:
|
||||||
|
is404 = True
|
||||||
elif tag == _tag("D", "resourcetype"):
|
elif tag == _tag("D", "resourcetype"):
|
||||||
if item.is_principal:
|
if item.is_principal:
|
||||||
tag = ET.Element(_tag("D", "principal"))
|
tag = ET.Element(_tag("D", "principal"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user