[Commits] (jeffrey) - Changed the signature of OneTimeShare's get()
and put() to return the relevant collection
commits at osafoundation.org
commits at osafoundation.org
Fri Apr 8 19:05:54 PDT 2005
Commit by: jeffrey
Modified files:
chandler/parcels/osaf/framework/sharing/ICalendar.py 1.17 1.18
chandler/parcels/osaf/framework/sharing/Sharing.py 1.88 1.89
chandler/parcels/osaf/views/main/Main.py 1.157 1.158
Log message:
- Changed the signature of OneTimeShare's get() and put() to return the relevant collection
- Fixed Bug 2794, importing a ics file now adds an item to the sidebar
- Started importing/exporting status, mapping CANCELLED <-> fyi
Bugzilla links:
http://bugzilla.osafoundation.org/show_bug.cgi?id=2794
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/ICalendar.py.diff?r1=text&tr1=1.17&r2=text&tr2=1.18
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/Sharing.py.diff?r1=text&tr1=1.88&r2=text&tr2=1.89
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/Main.py.diff?r1=text&tr1=1.157&r2=text&tr2=1.158
Index: chandler/parcels/osaf/framework/sharing/ICalendar.py
diff -u chandler/parcels/osaf/framework/sharing/ICalendar.py:1.17 chandler/parcels/osaf/framework/sharing/ICalendar.py:1.18
--- chandler/parcels/osaf/framework/sharing/ICalendar.py:1.17 Wed Mar 30 15:10:30 2005
+++ chandler/parcels/osaf/framework/sharing/ICalendar.py Fri Apr 8 19:05:51 2005
@@ -96,6 +96,13 @@
except AttributeError:
pass
try:
+ if taskorevent == 'EVENT':
+ status = item.transparency.upper()
+ if status == 'FYI': status = 'CANCELLED'
+ comp.add('status').value = status
+ except AttributeError:
+ pass
+ try:
comp.add('description').value = item.body.getReader().read()
except AttributeError:
pass
@@ -209,6 +216,17 @@
location = None
try:
+ status = event.status[0].value.lower()
+ if status in ('confirmed', 'tentative'):
+ pass
+ elif status == 'cancelled': #Chandler doesn't have CANCELLED
+ status = 'fyi'
+ else:
+ status = 'confirmed'
+ except AttributeError:
+ status = 'confirmed'
+
+ try:
# FIXME assumes DURATION, not DATE-TIME
reminderDelta = event.valarm[0].trigger[0].value
except AttributeError:
@@ -284,12 +302,13 @@
if duration is not None:
eventItem.dueDate = convertToMX(dt + duration)
+ eventItem.transparency = status
# I think Item.description describes a Kind, not userdata, so
# I'm using DESCRIPTION <-> body
if description is not None:
eventItem.body = textKind.makeValue(description)
-
+
if location is not None:
eventItem.location = Calendar.Location.getLocation(view,
location)
Index: chandler/parcels/osaf/views/main/Main.py
diff -u chandler/parcels/osaf/views/main/Main.py:1.157 chandler/parcels/osaf/views/main/Main.py:1.158
--- chandler/parcels/osaf/views/main/Main.py:1.157 Thu Mar 17 14:48:45 2005
+++ chandler/parcels/osaf/views/main/Main.py Fri Apr 8 19:05:52 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.157 $"
-__date__ = "$Date: 2005/03/17 22:48:45 $"
+__version__ = "$Revision: 1.158 $"
+__date__ = "$Date: 2005/04/09 02:05:52 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -353,7 +353,8 @@
try:
share = Sharing.OneTimeFileSystemShare(dir, filename,
ICalendar.ICalendarFormat, view=self.itsView)
- share.get()
+ collection = share.get()
+ self.postEventByName ("AddToSidebarWithoutCopyingAndSelectFirst", {'items':[collection]})
self.setStatusMessage ("Import completed")
except:
trace = "".join(traceback.format_exception (*sys.exc_info()))
Index: chandler/parcels/osaf/framework/sharing/Sharing.py
diff -u chandler/parcels/osaf/framework/sharing/Sharing.py:1.88 chandler/parcels/osaf/framework/sharing/Sharing.py:1.89
--- chandler/parcels/osaf/framework/sharing/Sharing.py:1.88 Mon Mar 28 15:45:29 2005
+++ chandler/parcels/osaf/framework/sharing/Sharing.py Fri Apr 8 19:05:51 2005
@@ -1,5 +1,5 @@
-Allowed = "$Revision: 1.88 $"
-__date__ = "$Date: 2005/03/28 23:45:29 $"
+Allowed = "$Revision: 1.89 $"
+__date__ = "$Date: 2005/04/09 02:05:51 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -105,11 +105,15 @@
def put(self):
super(OneTimeShare, self).put()
+ collection = self.contents
self.remove()
+ return collection
def get(self):
super(OneTimeShare, self).get()
+ collection = self.contents
self.remove()
+ return collection
More information about the Commits
mailing list