[CalendarServer-changes] [6050] CalendarServer/branches/users/glyph/sql-store/txcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed Aug 11 09:26:38 PDT 2010
Revision: 6050
http://trac.macosforge.org/projects/calendarserver/changeset/6050
Author: glyph at apple.com
Date: 2010-08-11 09:26:38 -0700 (Wed, 11 Aug 2010)
Log Message:
-----------
fixes for dropbox CDT
Modified Paths:
--------------
CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py
CalendarServer/branches/users/glyph/sql-store/txcaldav/icalendarstore.py
Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py 2010-08-11 16:16:35 UTC (rev 6049)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py 2010-08-11 16:26:38 UTC (rev 6050)
@@ -62,7 +62,7 @@
from txdav.propertystore.base import AbstractPropertyStore, PropertyName
from txdav.propertystore.none import PropertyStore
-from twext.web2.http_headers import MimeType
+from twext.web2.http_headers import MimeType, generateContentType
from twext.web2.dav.element.parser import WebDAVDocument
from twext.python.vcomponent import VComponent
@@ -277,7 +277,12 @@
def _attachmentPath(self, name):
- return self._calendar._home._txn._store.attachmentsPath.child(
+ attachmentRoot = self._calendar._home._txn._store.attachmentsPath
+ try:
+ attachmentRoot.createDirectory()
+ except:
+ pass
+ return attachmentRoot.child(
"%s-%s-%s-%s.attachment" % (
self._calendar._home.uid(), self._calendar.name(),
self.name(), name
@@ -294,7 +299,7 @@
values (%s, %s, %s, %s, %s)
""",
[
- self._resourceID, str(contentType), 0, "",
+ self._resourceID, generateContentType(contentType), 0, "",
attachment._pathValue()
]
)
@@ -351,7 +356,11 @@
return None
+ def attendeesCanManageAttachments(self):
+ return self.component().hasPropertyInAnyComponent("X-APPLE-DROPBOX")
+
+
def _pathToName(path):
return path.rsplit(".", 1)[0].split("-", 3)[-1]
@@ -460,8 +469,7 @@
def loseConnection(self):
self.attachment._path.setContent(self.buf)
pathValue = self.attachment._pathValue()
- contentTypeString = '%s/%s' % (self.contentType.mediaType,
- self.contentType.mediaSubtype)
+ contentTypeString = generateContentType(self.contentType)
self._txn.execSQL(
"update ATTACHMENT set CONTENT_TYPE = %s, MD5 = %s "
"WHERE PATH = %s",
Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/icalendarstore.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/icalendarstore.py 2010-08-11 16:16:35 UTC (rev 6049)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/icalendarstore.py 2010-08-11 16:26:38 UTC (rev 6050)
@@ -381,7 +381,15 @@
"""
+ def attendeesCanManageAttachments():
+ """
+ Are attendees allowed to manage attachments?
+ @return: C{True} if they can, C{False} if they can't.
+ """
+
+
+
class IAttachment(IDataStoreResource):
"""
Information associated with an attachment to a calendar object.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100811/7453df6f/attachment-0001.html>
More information about the calendarserver-changes
mailing list