scratchpad/drag-n-drop fixes

svn: r6194
This commit is contained in:
Don Allingham
2006-03-22 23:03:57 +00:00
parent d6a44469e0
commit 389fa7263e
24 changed files with 273 additions and 114 deletions
+1 -1
View File
@@ -512,7 +512,7 @@ class Date:
if self.is_compound():
ry = max(self.dateval[Date._POS_RYR],1)
rm = max(self.dateval[Date._POS_RMON],1)
rd = max(self.dateval[_POS_RDAY],1)
rd = max(self.dateval[Date._POS_RDAY],1)
sdn = Date._calendar_convert[self.calendar](ry,rm,rd)
(ny,nm,nd) = Date._calendar_change[calendar](sdn)
self.dateval = (d,m,y,self.dateval[Date._POS_SL],
+1
View File
@@ -68,6 +68,7 @@ class EventRef(BaseObject,PrivacyBase,NoteBase):
"""
Creates a new EventRef instance, copying from the source if present.
"""
BaseObject.__init__(self)
PrivacyBase.__init__(self)
NoteBase.__init__(self)
if source:
+1 -1
View File
@@ -437,7 +437,7 @@ class Family(PrimaryObject,SourceNote,MediaBase,AttributeBase):
Person's L{EventRef} list.
@type event_ref: EventRef
"""
if event_ref is not None and not isinstance(event_ref,EventRef):
if event_ref and not isinstance(event_ref,EventRef):
raise ValueError("Expecting EventRef instance")
self.event_ref_list.append(event_ref)
+1 -1
View File
@@ -57,7 +57,7 @@ class Note(BaseObject):
return (self.text,self.format)
def unserialize(self,data):
if data is not None:
if data:
(self.text,self.format) = data
return self
+5 -5
View File
@@ -245,7 +245,7 @@ class Person(PrimaryObject,SourceNote,
elif classname == 'Place':
for ordinance in [self.lds_bapt,self.lds_endow,self.lds_seal]:
if ordinance.place in handle_list:
ordinance.place == None
ordinance.place = None
def _replace_handle_reference(self,classname,old_handle,new_handle):
if classname == 'Event':
@@ -273,7 +273,7 @@ class Person(PrimaryObject,SourceNote,
elif classname == 'Place':
for ordinance in [self.lds_bapt,self.lds_endow,self.lds_seal]:
if ordinance.place == old_handle:
ordinance.place == new_handle
ordinance.place = new_handle
def get_text_data_list(self):
"""
@@ -456,7 +456,7 @@ class Person(PrimaryObject,SourceNote,
the Person's birth.
@type event_handle: EventRef
"""
if event_ref is not None and not isinstance(event_ref,EventRef):
if event_ref and not isinstance(event_ref,EventRef):
raise ValueError("Expecting EventRef instance")
self.birth_ref = event_ref
@@ -479,7 +479,7 @@ class Person(PrimaryObject,SourceNote,
the Person's death.
@type event_handle: EventRef
"""
if event_ref is not None and not isinstance(event_ref,EventRef):
if event_ref and not isinstance(event_ref,EventRef):
raise ValueError("Expecting EventRef instance")
self.death_ref = event_ref
@@ -542,7 +542,7 @@ class Person(PrimaryObject,SourceNote,
Person's L{EventRef} list.
@type event_ref: EventRef
"""
if event_ref is not None and not isinstance(event_ref,EventRef):
if event_ref and not isinstance(event_ref,EventRef):
raise ValueError("Expecting EventRef instance")
self.event_ref_list.append(event_ref)