Update of /cvsroot/zxsync/zXSync/zxsync
In directory sc8-pr-cvs1:/tmp/cvs-serv30061
Modified Files:
syncbase.py vcard.py
Log Message:
- supported marking a field as "generated" (so it can be treated as non-conflicting)
Index: syncbase.py
===================================================================
RCS file: /cvsroot/zxsync/zXSync/zxsync/syncbase.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** syncbase.py 13 Jul 2003 09:13:01 -0000 1.6
--- syncbase.py 14 Aug 2003 20:00:44 -0000 1.7
***************
*** 685,688 ****
--- 685,689 ----
HierarchyElement.__init__(self, id)
self.value = value
+ self.generated = 0
***************
*** 710,713 ****
--- 711,731 ----
+ def setGenerated(self, generated):
+ """
+ Marks this field as generated or not (with not generated being the
+ default). This information can be used in subclasses to determine if
+ there's a conflict with another field (since generated fields should
+ generally not be considered conflicting with anything).
+ """
+ self.generated = generated
+
+
+ def isGenerated(self):
+ """
+ Returns whether this field is marked as generated.
+ """
+ return self.generated
+
+
def conflictsWith(self, field):
"""
Index: vcard.py
===================================================================
RCS file: /cvsroot/zxsync/zXSync/zxsync/vcard.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** vcard.py 13 Jul 2003 09:08:17 -0000 1.8
--- vcard.py 14 Aug 2003 20:00:44 -0000 1.9
***************
*** 443,450 ****
def doesConflictWith(self, other):
! if self.getValue() == other.getValue(): #or self.getId() == UID:
! # UIDs never conflict
! # (now obsolete since UIDs are no longer treated as ordinary
! # fields)
return 0
return 1
--- 443,448 ----
def doesConflictWith(self, other):
! if self.getValue() == other.getValue() or self.isGenerated():
! # generated fields never conflict
return 0
return 1
|