[Chandler-dev] Moving sharing-specific attributes out of ContentItem

Morgen Sagen morgen at osafoundation.org
Sat Jan 27 01:15:35 PST 2007


On Jan 26, 2007, at 5:44 PM, Phillip J. Eby wrote:

> At 05:04 PM 1/26/2007 -0800, Grant Baillie wrote:
>> Hmmm... I'm not sure that's the simplest solution, though:
>> essentially this adds a new stamping feature.
>
> Well, at least it's only two lines of code, or one if you cram the  
> "return True" on the "def" line.  :)
>
>
>> I agree the EventStamp.isAttributeModifiable() implementation is
>> useless as it stands. But, do any stamps need to override what's on
>> ContentItem?
>
> The new SharedItem stamp does.  That was actually the point of  
> Morgen's original question, so we could remove osaf.pim's  
> dependency on osaf.sharing (and along with it, some of the last  
> uses of 'otherName' and other cycle-breaking tricks).

Exactly.  Since sharedIn is moving out of ContentItem into  
sharing.SharedItem (stamp), the logic for isAttributeModifiable must  
also live in SharedItem.  Phillip's suggestion of having ContentItem  
delegate this to stamps in a general way means ContentItem doesn't  
need to know about sharing.

I have this implemented now in my tree, and along the way I removed  
other dependencies on sharing-related attributes, like collection's  
knowledge of "shares" and "isReadOnly".  isReadOnly( ) is a function  
in osaf.sharing now.  Same thing for what used to be  
ContentItem.getSharedState( ).

Now the only two places where osaf.pim has a dependency on sharing  
are in calendar/Calendar.py and calendar/TimeZone.py.  The Occurrence  
class has an iterModifiedAttributes( ) method which compares  
occurrence values against the master.  I had to modify this to ignore  
the SharedItem stamp on the master.  In TimeZone.py there is a  
convertFloatingEvents( ) function which needs to examine the shared  
state of an item, and the only way to do this is to import osaf.sharing.

These changes should be in the trunk by Monday.

~morgen


More information about the chandler-dev mailing list