Conflicting Results

February 28th, 2007 No Comments »
I just made my first successful conflict in Chandler’s PyShell. Woo!

PyShell 0.9.5 - The Flakiest Python Shell
Python 2.5 (r25:51908, Jan 31 2007, 21:59:50)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>uuid="27e5e1d4-53ad-40e4-860d-503a137a0806"
>>>item = view.findUUID(uuid)
>>>from osaf import sharing
>>>sharing.SharedItem(item).add()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/rae/work/osaf/chandler/chandler/parcels/osaf/pim/stamping.py", line 112, in add
    "Item %r already has stamp %r" % (self.itsItem, self)
StampAlreadyPresentError: Item <Note: 27e5e1d4-53ad-40e4-860d-503a137a0806> already has stamp SharedItem(<Note: 27e5e1d4-53ad-40e4-860d-503a137a0806>)
>>>sharing.SharedItem(item).generateConflicts()
>>>item
<Note: 27e5e1d4-53ad-40e4-860d-503a137a0806>
>>>cstates = sharing.SharedItem(item).conflictingStates
>>>cstates
<DBRefList: It's a New Event.osaf.sharing.shares.SharedItem.conflictingStates<->conflictFor>
>>>conflictsGenerator = sharing.SharedItem(item).getConflicts()
>>>for conflict in conflictsGenerator:
…    f = conflict.field
…    v = conflict.value
…    p = conflict.peer
…    print "[%s]=%s (%s)" % (f, v, p)

[location]=San Jose (conflict@example.com)
[title]=XYZZY (conflict@example.com)
[body]=PLUGH (conflict@example.com)
>>>

.. one small step for conflicts..