[CalendarServer-changes] [14326] CalendarServer/branches/users/sagen/trashcan-3
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jan 19 10:50:50 PST 2015
Revision: 14326
http://trac.calendarserver.org//changeset/14326
Author: sagen at apple.com
Date: 2015-01-19 10:50:50 -0800 (Mon, 19 Jan 2015)
Log Message:
-----------
Trash is an optional extra
Modified Paths:
--------------
CalendarServer/branches/users/sagen/trashcan-3/twistedcaldav/stdconfig.py
CalendarServer/branches/users/sagen/trashcan-3/txdav/caldav/datastore/sql.py
CalendarServer/branches/users/sagen/trashcan-3/txdav/common/datastore/sql.py
Modified: CalendarServer/branches/users/sagen/trashcan-3/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-3/twistedcaldav/stdconfig.py 2015-01-19 17:30:42 UTC (rev 14325)
+++ CalendarServer/branches/users/sagen/trashcan-3/twistedcaldav/stdconfig.py 2015-01-19 18:50:50 UTC (rev 14326)
@@ -577,7 +577,9 @@
# "VPOLL",
],
- "ParallelUpgrades" : False, # Perform upgrades - currently only the
+ "EnableTrashCollection": False, # Enable Trash Collection
+
+ "ParallelUpgrades": False, # Perform upgrades - currently only the
# database -> filesystem migration - but in
# the future, hopefully all relevant
# upgrades - in parallel in subprocesses.
Modified: CalendarServer/branches/users/sagen/trashcan-3/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-3/txdav/caldav/datastore/sql.py 2015-01-19 17:30:42 UTC (rev 14325)
+++ CalendarServer/branches/users/sagen/trashcan-3/txdav/caldav/datastore/sql.py 2015-01-19 18:50:50 UTC (rev 14326)
@@ -3936,7 +3936,7 @@
if self._dropboxID:
yield DropBoxAttachment.resourceRemoved(self._txn, self._resourceID, self._dropboxID)
yield ManagedAttachment.resourceRemoved(self._txn, self._resourceID)
- yield super(CalendarObject, self).reallyRemove()
+ yield super(CalendarObject, self).remove()
# Do scheduling
if scheduler is not None:
Modified: CalendarServer/branches/users/sagen/trashcan-3/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-3/txdav/common/datastore/sql.py 2015-01-19 17:30:42 UTC (rev 14325)
+++ CalendarServer/branches/users/sagen/trashcan-3/txdav/common/datastore/sql.py 2015-01-19 18:50:50 UTC (rev 14326)
@@ -7351,10 +7351,14 @@
Just moves the object to the trash
"""
- if self._parentCollection.isTrash():
- raise AlreadyInTrashError
+
+ if config.EnableTrashCollection:
+ if self._parentCollection.isTrash():
+ raise AlreadyInTrashError
+ else:
+ yield self.toTrash()
else:
- yield self.toTrash()
+ yield self.reallyRemove(options=options)
@inlineCallbacks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150119/d2070c03/attachment.html>
More information about the calendarserver-changes
mailing list