Add getetag and getcontenttype support for propfind requests (Sunbird 1.0 ready).
This commit is contained in:
parent
41741ba989
commit
6545bc8273
@ -60,6 +60,10 @@ class Calendar(object):
|
|||||||
"""Return unicode calendar from the calendar."""
|
"""Return unicode calendar from the calendar."""
|
||||||
return unicode(support.read(self.cal), self.encoding)
|
return unicode(support.read(self.cal), self.encoding)
|
||||||
|
|
||||||
|
def etag(self):
|
||||||
|
"""Return etag from calendar."""
|
||||||
|
return hash_tag(self.vcalendar())
|
||||||
|
|
||||||
class Event(object):
|
class Event(object):
|
||||||
"""Internal event class."""
|
"""Internal event class."""
|
||||||
def __init__(self, vcalendar):
|
def __init__(self, vcalendar):
|
||||||
|
@ -105,6 +105,16 @@ def propfind(xml_request, calendar, url):
|
|||||||
owner.text = calendar.owner
|
owner.text = calendar.owner
|
||||||
prop.append(owner)
|
prop.append(owner)
|
||||||
|
|
||||||
|
if _tag("D", "getcontenttype") in properties:
|
||||||
|
getcontenttype = ET.Element(_tag("D", "getcontenttype"))
|
||||||
|
getcontenttype.text = "text/calendar"
|
||||||
|
prop.append(getcontenttype)
|
||||||
|
|
||||||
|
if _tag("D", "getetag") in properties:
|
||||||
|
getetag = ET.Element(_tag("D", "getetag"))
|
||||||
|
getetag.text = calendar.etag()
|
||||||
|
prop.append(getetag)
|
||||||
|
|
||||||
if _tag("CS", "getctag") in properties:
|
if _tag("CS", "getctag") in properties:
|
||||||
getctag = ET.Element(_tag("CS", "getctag"))
|
getctag = ET.Element(_tag("CS", "getctag"))
|
||||||
getctag.text = calendar.ctag
|
getctag.text = calendar.ctag
|
||||||
|
Loading…
Reference in New Issue
Block a user