2006-04-19 Don Allingham <don@gramps-project.org>
* src/DataViews/_EventView.py: more GrampsTypes changes * src/DataViews/_PedigreeView.py: more GrampsTypes changes * src/RelLib/_ChildRef.py: more GrampsTypes changes * src/RelLib/_Family.py: more GrampsTypes changes * src/RelLib/_Repository.py: more GrampsTypes changes * src/RelLib/_Event.py: more GrampsTypes changes * src/Editors/_EditPerson.py: more GrampsTypes changes * src/Editors/_EditEventRef.py: more GrampsTypes changes * src/Editors/_EditEvent.py: more GrampsTypes changes * src/PeopleModel.py: more GrampsTypes changes * src/DisplayTabs.py: more GrampsTypes changes * src/GrampsWidgets.py: more GrampsTypes changes * src/Utils.py: more GrampsTypes changes * src/PageView.py: more GrampsTypes changes svn: r6373
This commit is contained in:
@@ -1,3 +1,19 @@
|
|||||||
|
2006-04-19 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/DataViews/_EventView.py: more GrampsTypes changes
|
||||||
|
* src/DataViews/_PedigreeView.py: more GrampsTypes changes
|
||||||
|
* src/RelLib/_ChildRef.py: more GrampsTypes changes
|
||||||
|
* src/RelLib/_Family.py: more GrampsTypes changes
|
||||||
|
* src/RelLib/_Repository.py: more GrampsTypes changes
|
||||||
|
* src/RelLib/_Event.py: more GrampsTypes changes
|
||||||
|
* src/Editors/_EditPerson.py: more GrampsTypes changes
|
||||||
|
* src/Editors/_EditEventRef.py: more GrampsTypes changes
|
||||||
|
* src/Editors/_EditEvent.py: more GrampsTypes changes
|
||||||
|
* src/PeopleModel.py: more GrampsTypes changes
|
||||||
|
* src/DisplayTabs.py: more GrampsTypes changes
|
||||||
|
* src/GrampsWidgets.py: more GrampsTypes changes
|
||||||
|
* src/Utils.py: more GrampsTypes changes
|
||||||
|
* src/PageView.py: more GrampsTypes changes
|
||||||
|
|
||||||
2006-04-19 Alex Roitman <shura@gramps-project.org>
|
2006-04-19 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/Utils.py: Remove obsolete code.
|
* src/Utils.py: Remove obsolete code.
|
||||||
* src/DisplayTabs.py (EventRefModel.column_role): Adapt to new types.
|
* src/DisplayTabs.py (EventRefModel.column_role): Adapt to new types.
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ import PageView
|
|||||||
import DisplayModels
|
import DisplayModels
|
||||||
import const
|
import const
|
||||||
import Utils
|
import Utils
|
||||||
|
import Errors
|
||||||
|
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
from QuestionDialog import QuestionDialog, ErrorDialog
|
from QuestionDialog import QuestionDialog, ErrorDialog
|
||||||
from Editors import EditEvent, DelEventQuery
|
from Editors import EditEvent, DelEventQuery
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ from cgi import escape
|
|||||||
# GTK/Gnome modules
|
# GTK/Gnome modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gobject
|
|
||||||
import gtk
|
import gtk
|
||||||
import gtk.gdk
|
import gtk.gdk
|
||||||
try:
|
try:
|
||||||
@@ -49,7 +48,6 @@ except:
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import RelLib
|
import RelLib
|
||||||
import PageView
|
import PageView
|
||||||
import Relationship
|
|
||||||
import NameDisplay
|
import NameDisplay
|
||||||
import Utils
|
import Utils
|
||||||
import DateHandler
|
import DateHandler
|
||||||
@@ -361,9 +359,7 @@ class FormattingHelper:
|
|||||||
if event and int(event.get_type()) == RelLib.EventType.MARRIAGE:
|
if event and int(event.get_type()) == RelLib.EventType.MARRIAGE:
|
||||||
if line_count < 3:
|
if line_count < 3:
|
||||||
return DateHandler.get_date(event)
|
return DateHandler.get_date(event)
|
||||||
i = int(event.get_type())
|
name = str(event.get_type())
|
||||||
s = str(even.get_type())
|
|
||||||
name = Utils.family_events.get(i)
|
|
||||||
text += name
|
text += name
|
||||||
text += "\n"
|
text += "\n"
|
||||||
text += DateHandler.get_date(event)
|
text += DateHandler.get_date(event)
|
||||||
@@ -732,9 +728,6 @@ class PedigreeView(PageView.PersonNavView):
|
|||||||
self.rebuild( self.table_4, pos_4, person)
|
self.rebuild( self.table_4, pos_4, person)
|
||||||
self.rebuild( self.table_5, pos_5, person)
|
self.rebuild( self.table_5, pos_5, person)
|
||||||
|
|
||||||
#gobject.idle_add(self.request_resize)
|
|
||||||
|
|
||||||
|
|
||||||
def rebuild( self, table_widget, positions, active_person):
|
def rebuild( self, table_widget, positions, active_person):
|
||||||
# Build ancestor tree
|
# Build ancestor tree
|
||||||
lst = [None]*31
|
lst = [None]*31
|
||||||
|
|||||||
@@ -672,7 +672,7 @@ class EventEmbedList(EmbeddedList):
|
|||||||
return RelLib.EventType(RelLib.EventType.MARRIAGE)
|
return RelLib.EventType(RelLib.EventType.MARRIAGE)
|
||||||
|
|
||||||
def default_role(self):
|
def default_role(self):
|
||||||
return (RelLib.EventRoleType.FAMILY, '')
|
return RelLib.EventRoleType(RelLib.EventRoleType.FAMILY)
|
||||||
|
|
||||||
def add_button_clicked(self, obj):
|
def add_button_clicked(self, obj):
|
||||||
try:
|
try:
|
||||||
@@ -735,7 +735,7 @@ class PersonEventEmbedList(EventEmbedList):
|
|||||||
return self.orig_data
|
return self.orig_data
|
||||||
|
|
||||||
def default_role(self):
|
def default_role(self):
|
||||||
return (RelLib.EventRoleType.PRIMARY, '')
|
return RelLib.EventRoleType(RelLib.EventRoleType.PRIMARY)
|
||||||
|
|
||||||
def default_type(self):
|
def default_type(self):
|
||||||
type_list = []
|
type_list = []
|
||||||
|
|||||||
@@ -82,14 +82,6 @@ class EditEvent(EditPrimary):
|
|||||||
def empty_object(self):
|
def empty_object(self):
|
||||||
return RelLib.Event()
|
return RelLib.Event()
|
||||||
|
|
||||||
def get_base_events(self):
|
|
||||||
new_batch = {}
|
|
||||||
for key in Utils.personal_events:
|
|
||||||
new_batch[key] = Utils.personal_events[key]
|
|
||||||
for key in Utils.family_events:
|
|
||||||
new_batch[key] = Utils.family_events[key]
|
|
||||||
return new_batch
|
|
||||||
|
|
||||||
def get_custom_events(self):
|
def get_custom_events(self):
|
||||||
return self.dbstate.db.get_person_event_type_list() + \
|
return self.dbstate.db.get_person_event_type_list() + \
|
||||||
self.dbstate.db.get_family_event_types()
|
self.dbstate.db.get_family_event_types()
|
||||||
@@ -240,9 +232,6 @@ class EditPersonEvent(EditEvent):
|
|||||||
def _init_event(self):
|
def _init_event(self):
|
||||||
self.commit_event = self.db.commit_personal_event
|
self.commit_event = self.db.commit_personal_event
|
||||||
|
|
||||||
def get_base_events(self):
|
|
||||||
return Utils.personal_events
|
|
||||||
|
|
||||||
def get_custom_events(self):
|
def get_custom_events(self):
|
||||||
return self.dbstate.db.get_person_event_type_list()
|
return self.dbstate.db.get_person_event_type_list()
|
||||||
|
|
||||||
@@ -255,9 +244,6 @@ class EditFamilyEvent(EditEvent):
|
|||||||
def _init_event(self):
|
def _init_event(self):
|
||||||
self.commit_event = self.db.commit_family_event
|
self.commit_event = self.db.commit_family_event
|
||||||
|
|
||||||
def get_base_events(self):
|
|
||||||
return Utils.family_events
|
|
||||||
|
|
||||||
def get_custom_events(self):
|
def get_custom_events(self):
|
||||||
return self.dbstate.db.get_family_event_types()
|
return self.dbstate.db.get_family_event_types()
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ import gtk.glade
|
|||||||
import const
|
import const
|
||||||
import Utils
|
import Utils
|
||||||
import RelLib
|
import RelLib
|
||||||
import DisplayState
|
|
||||||
|
|
||||||
from DisplayTabs import *
|
from DisplayTabs import *
|
||||||
from GrampsWidgets import *
|
from GrampsWidgets import *
|
||||||
@@ -84,12 +83,6 @@ class EditEventRef(EditReference):
|
|||||||
self.commit_event = self.db.commit_personal_event
|
self.commit_event = self.db.commit_personal_event
|
||||||
self.add_event = self.db.add_person_event
|
self.add_event = self.db.add_person_event
|
||||||
|
|
||||||
def get_roles(self):
|
|
||||||
return Utils.event_roles
|
|
||||||
|
|
||||||
def get_event_types(self):
|
|
||||||
return Utils.personal_events
|
|
||||||
|
|
||||||
def get_custom_events(self):
|
def get_custom_events(self):
|
||||||
return [ (RelLib.EventType.CUSTOM,val) \
|
return [ (RelLib.EventType.CUSTOM,val) \
|
||||||
for val in self.dbstate.db.get_person_event_types()]
|
for val in self.dbstate.db.get_person_event_types()]
|
||||||
@@ -126,12 +119,11 @@ class EditEventRef(EditReference):
|
|||||||
self.top.get_widget("eer_ev_priv"),
|
self.top.get_widget("eer_ev_priv"),
|
||||||
self.source)
|
self.source)
|
||||||
|
|
||||||
self.role_selector = MonitoredType(
|
self.role_selector = MonitoredDataType(
|
||||||
self.top.get_widget('eer_role_combo'),
|
self.top.get_widget('eer_role_combo'),
|
||||||
self.source_ref.set_role,
|
self.source_ref.set_role,
|
||||||
self.source_ref.get_role,
|
self.source_ref.get_role,
|
||||||
self.get_roles(),
|
)
|
||||||
RelLib.EventRef.CUSTOM)
|
|
||||||
|
|
||||||
self.event_menu = MonitoredDataType(
|
self.event_menu = MonitoredDataType(
|
||||||
self.top.get_widget("eer_type_combo"),
|
self.top.get_widget("eer_type_combo"),
|
||||||
@@ -174,7 +166,7 @@ class EditEventRef(EditReference):
|
|||||||
notebook,
|
notebook,
|
||||||
GalleryTab(self.dbstate, self.uistate, self.track,
|
GalleryTab(self.dbstate, self.uistate, self.track,
|
||||||
self.source.get_media_list()))
|
self.source.get_media_list()))
|
||||||
|
|
||||||
self.backref_tab = self._add_tab(
|
self.backref_tab = self._add_tab(
|
||||||
notebook,
|
notebook,
|
||||||
EventBackRefList(self.dbstate, self.uistate, self.track,
|
EventBackRefList(self.dbstate, self.uistate, self.track,
|
||||||
@@ -231,11 +223,9 @@ class EditFamilyEventRef(EditEventRef):
|
|||||||
def get_roles(self):
|
def get_roles(self):
|
||||||
return Utils.event_roles
|
return Utils.event_roles
|
||||||
|
|
||||||
def get_event_types(self):
|
|
||||||
return Utils.family_events
|
|
||||||
|
|
||||||
def get_custom_events(self):
|
def get_custom_events(self):
|
||||||
return [ RelLib.EventType((RelLib.EventType.CUSTOM,val)) for val in self.dbstate.db.get_family_event_types()]
|
return [ RelLib.EventType((RelLib.EventType.CUSTOM,val)) \
|
||||||
|
for val in self.dbstate.db.get_family_event_types()]
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -175,12 +175,10 @@ class EditPerson(EditPrimary):
|
|||||||
self.pname.get_type,
|
self.pname.get_type,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.marker = GrampsWidgets.MonitoredType(
|
self.marker = GrampsWidgets.MonitoredDataType(
|
||||||
self.top.get_widget('marker'),
|
self.top.get_widget('marker'),
|
||||||
self.obj.set_marker,
|
self.obj.set_marker,
|
||||||
self.obj.get_marker,
|
self.obj.get_marker,
|
||||||
dict(Utils.marker_types),
|
|
||||||
RelLib.MarkerType.CUSTOM,
|
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
if self.use_patronymic:
|
if self.use_patronymic:
|
||||||
|
|||||||
@@ -354,9 +354,9 @@ class MonitoredDataType:
|
|||||||
self.obj = obj
|
self.obj = obj
|
||||||
|
|
||||||
val = get_val()
|
val = get_val()
|
||||||
|
|
||||||
if val:
|
if val:
|
||||||
default = int(val)
|
default = int(val)
|
||||||
print val, default
|
|
||||||
else:
|
else:
|
||||||
default = None
|
default = None
|
||||||
|
|
||||||
@@ -369,6 +369,10 @@ class MonitoredDataType:
|
|||||||
|
|
||||||
value = self.sel.get_values()
|
value = self.sel.get_values()
|
||||||
self.set_val(self.fix_value(value))
|
self.set_val(self.fix_value(value))
|
||||||
|
|
||||||
|
if val.is_custom():
|
||||||
|
obj.child.set_text(str(val))
|
||||||
|
|
||||||
self.obj.set_sensitive(not readonly)
|
self.obj.set_sensitive(not readonly)
|
||||||
self.obj.connect('changed', self.on_change)
|
self.obj.connect('changed', self.on_change)
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,15 @@ class PageView:
|
|||||||
def change_page(self):
|
def change_page(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def edit(self,obj):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def remove(self,obj):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def add(self,obj):
|
||||||
|
pass
|
||||||
|
|
||||||
def key_press(self,obj,event):
|
def key_press(self,obj,event):
|
||||||
ret_key = gtk.gdk.keyval_from_name("Return")
|
ret_key = gtk.gdk.keyval_from_name("Return")
|
||||||
if event.keyval == ret_key and not event.state:
|
if event.keyval == ret_key and not event.state:
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ import NameDisplay
|
|||||||
import DateHandler
|
import DateHandler
|
||||||
import ToolTips
|
import ToolTips
|
||||||
import GrampsLocale
|
import GrampsLocale
|
||||||
import Utils
|
|
||||||
import const
|
import const
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@@ -268,10 +267,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
return COLUMN_DEFS[col][COLUMN_DEF_LIST](self,
|
return COLUMN_DEFS[col][COLUMN_DEF_LIST](self,
|
||||||
self.prev_data, node)
|
self.prev_data, node)
|
||||||
except:
|
except:
|
||||||
if col == _MARKER_COL:
|
return None
|
||||||
return None
|
|
||||||
else:
|
|
||||||
return u'error'
|
|
||||||
|
|
||||||
def on_iter_next(self, node):
|
def on_iter_next(self, node):
|
||||||
'''returns the next node at this level of the tree'''
|
'''returns the next node at this level of the tree'''
|
||||||
@@ -378,7 +374,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
event = self.db.get_event_from_handle(er.ref)
|
event = self.db.get_event_from_handle(er.ref)
|
||||||
etype = event.get_type()[0]
|
etype = event.get_type()[0]
|
||||||
date_str = DateHandler.get_date(event)
|
date_str = DateHandler.get_date(event)
|
||||||
if (etype in [Event.BAPTISM, Event.CHRISTEN]
|
if (etype in [EventType.BAPTISM, EventType.CHRISTEN]
|
||||||
and date_str != ""):
|
and date_str != ""):
|
||||||
return "<i>" + cgi.escape(date_str) + "</i>"
|
return "<i>" + cgi.escape(date_str) + "</i>"
|
||||||
|
|
||||||
@@ -399,7 +395,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
event = self.db.get_event_from_handle(er.ref)
|
event = self.db.get_event_from_handle(er.ref)
|
||||||
etype = event.get_type()[0]
|
etype = event.get_type()[0]
|
||||||
date_str = DateHandler.get_date(event)
|
date_str = DateHandler.get_date(event)
|
||||||
if (etype in [Event.BURIAL, Event.CREMATION]
|
if (etype in [EventType.BURIAL, EventType.CREMATION]
|
||||||
and date_str != ""):
|
and date_str != ""):
|
||||||
return "<i>" + cgi.escape(date_str) + "</i>"
|
return "<i>" + cgi.escape(date_str) + "</i>"
|
||||||
|
|
||||||
@@ -431,7 +427,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
er.unserialize(event_ref)
|
er.unserialize(event_ref)
|
||||||
event = self.db.get_event_from_handle(er.ref)
|
event = self.db.get_event_from_handle(er.ref)
|
||||||
etype = event.get_type()[0]
|
etype = event.get_type()[0]
|
||||||
if etype in [Event.BAPTISM, Event.CHRISTEN]:
|
if etype in [EventType.BAPTISM, EventType.CHRISTEN]:
|
||||||
place_handle = event.get_place_handle()
|
place_handle = event.get_place_handle()
|
||||||
if place_handle:
|
if place_handle:
|
||||||
place = self.db.get_place_from_handle(place_handle)
|
place = self.db.get_place_from_handle(place_handle)
|
||||||
@@ -459,7 +455,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
er.unserialize(event_ref)
|
er.unserialize(event_ref)
|
||||||
event = self.db.get_event_from_handle(er.ref)
|
event = self.db.get_event_from_handle(er.ref)
|
||||||
etype = event.get_type()[0]
|
etype = event.get_type()[0]
|
||||||
if etype in [Event.BURIAL, Event.CREMATION]:
|
if etype in [EventType.BURIAL, EventType.CREMATION]:
|
||||||
place_handle = event.get_place_handle()
|
place_handle = event.get_place_handle()
|
||||||
if place_handle:
|
if place_handle:
|
||||||
place = self.db.get_place_from_handle(place_handle)
|
place = self.db.get_place_from_handle(place_handle)
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class ChildRef(BaseObject,PrivacyBase,SourceBase,NoteBase,RefBase):
|
|||||||
@return: Returns the list of all textual attributes of the object.
|
@return: Returns the list of all textual attributes of the object.
|
||||||
@rtype: list
|
@rtype: list
|
||||||
"""
|
"""
|
||||||
return [self.rel, str(self.frel), str(mrel)]
|
return [str(self.frel), str(self.mrel)]
|
||||||
|
|
||||||
def get_text_data_child_list(self):
|
def get_text_data_child_list(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
|
|||||||
description = self.description
|
description = self.description
|
||||||
cause = self.cause
|
cause = self.cause
|
||||||
the_type = self.type
|
the_type = self.type
|
||||||
return (the_type == Event.CUSTOM and date.is_empty()
|
return (the_type == EventType.CUSTOM and date.is_empty()
|
||||||
and not place and not description and not cause)
|
and not place and not description and not cause)
|
||||||
|
|
||||||
def are_equal(self,other):
|
def are_equal(self,other):
|
||||||
@@ -238,23 +238,6 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_name(self,name):
|
|
||||||
warn( "Use set_type instead of set_name", DeprecationWarning, 2)
|
|
||||||
# INCOMPLETE Wrapper for old API
|
|
||||||
# remove when transitition done.
|
|
||||||
if name in range(-1,45):
|
|
||||||
the_type = (name,'')
|
|
||||||
else:
|
|
||||||
the_type = (Event.CUSTOM,name)
|
|
||||||
self.set_type(the_type)
|
|
||||||
|
|
||||||
def get_name(self):
|
|
||||||
warn( "Use get_type instead of get_name", DeprecationWarning, 2)
|
|
||||||
# INCOMPLETE Wrapper for old API
|
|
||||||
# remove when transitition done.
|
|
||||||
type = self.get_type()
|
|
||||||
return type[1]
|
|
||||||
|
|
||||||
def set_type(self,the_type):
|
def set_type(self,the_type):
|
||||||
"""
|
"""
|
||||||
Sets the type of the Event to the passed (int,str) tuple.
|
Sets the type of the Event to the passed (int,str) tuple.
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
|
|||||||
self.child_ref_list = []
|
self.child_ref_list = []
|
||||||
self.type = FamilyRelType()
|
self.type = FamilyRelType()
|
||||||
self.event_ref_list = []
|
self.event_ref_list = []
|
||||||
self.lds_seal = None
|
|
||||||
self.complete = 0
|
self.complete = 0
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
@@ -111,10 +110,6 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
|
|||||||
be considered persistent.
|
be considered persistent.
|
||||||
@rtype: tuple
|
@rtype: tuple
|
||||||
"""
|
"""
|
||||||
if self.lds_seal == None:
|
|
||||||
lds_seal = None
|
|
||||||
else:
|
|
||||||
lds_seal = self.lds_seal.serialize()
|
|
||||||
return (self.handle, self.gramps_id, self.father_handle,
|
return (self.handle, self.gramps_id, self.father_handle,
|
||||||
self.mother_handle,
|
self.mother_handle,
|
||||||
[cr.serialize() for cr in self.child_ref_list],
|
[cr.serialize() for cr in self.child_ref_list],
|
||||||
@@ -153,7 +148,7 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
|
|||||||
if classname == 'Event':
|
if classname == 'Event':
|
||||||
return handle in [ref.ref for ref in self.event_ref_list]
|
return handle in [ref.ref for ref in self.event_ref_list]
|
||||||
elif classname == 'Person':
|
elif classname == 'Person':
|
||||||
return handle in ([ref.ref for ref in self.child_list]
|
return handle in ([ref.ref for ref in self.child_ref_list]
|
||||||
+ [self.father_handle,self.mother_handle])
|
+ [self.father_handle,self.mother_handle])
|
||||||
elif classname == 'Place':
|
elif classname == 'Place':
|
||||||
return handle in [ x.place for x in self.lds_ord_list ]
|
return handle in [ x.place for x in self.lds_ord_list ]
|
||||||
@@ -381,7 +376,7 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
|
|||||||
in the list.
|
in the list.
|
||||||
@rtype: bool
|
@rtype: bool
|
||||||
"""
|
"""
|
||||||
if not isinstance(childref,ChildRef):
|
if not isinstance(child_ref,ChildRef):
|
||||||
raise ValueError("expecting ChildRef instance")
|
raise ValueError("expecting ChildRef instance")
|
||||||
new_list = [ref for ref in self.child_ref_list
|
new_list = [ref for ref in self.child_ref_list
|
||||||
if ref.ref != child_ref.ref ]
|
if ref.ref != child_ref.ref ]
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
|
|||||||
@type type: str
|
@type type: str
|
||||||
"""
|
"""
|
||||||
if type(the_type) == tuple:
|
if type(the_type) == tuple:
|
||||||
self.type = NameType(the_type)
|
self.type = RepositoryType(the_type)
|
||||||
else:
|
else:
|
||||||
self.type = the_type
|
self.type = the_type
|
||||||
|
|
||||||
|
|||||||
@@ -81,76 +81,6 @@ confidence = {
|
|||||||
def format_confidence( type):
|
def format_confidence( type):
|
||||||
return confidence.get(type[0],_("Invalid id %d ('%s')")%type)
|
return confidence.get(type[0],_("Invalid id %d ('%s')")%type)
|
||||||
|
|
||||||
# family_events = {
|
|
||||||
# RelLib.Event.UNKNOWN : _("Unknown"),
|
|
||||||
# RelLib.Event.CUSTOM : _("Custom"),
|
|
||||||
# RelLib.Event.MARRIAGE : _("Marriage"),
|
|
||||||
# RelLib.Event.MARR_SETTL : _("Marriage Settlement"),
|
|
||||||
# RelLib.Event.MARR_LIC : _("Marriage License"),
|
|
||||||
# RelLib.Event.MARR_CONTR : _("Marriage Contract"),
|
|
||||||
# RelLib.Event.MARR_BANNS : _("Marriage Banns"),
|
|
||||||
# RelLib.Event.ENGAGEMENT : _("Engagement"),
|
|
||||||
# RelLib.Event.DIVORCE : _("Divorce"),
|
|
||||||
# RelLib.Event.DIV_FILING : _("Divorce Filing"),
|
|
||||||
# RelLib.Event.ANNULMENT : _("Annulment"),
|
|
||||||
# RelLib.Event.MARR_ALT : _("Alternate Marriage"),
|
|
||||||
# }
|
|
||||||
# def format_family_event( type):
|
|
||||||
# if type[0] == RelLib.Event.CUSTOM:
|
|
||||||
# return type[1]
|
|
||||||
# return family_events.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
# personal_events = {
|
|
||||||
# RelLib.Event.UNKNOWN : _("Unknown"),
|
|
||||||
# RelLib.Event.CUSTOM : _("Custom"),
|
|
||||||
# RelLib.Event.ADOPT : _("Adopted"),
|
|
||||||
# RelLib.Event.BIRTH : _("Birth"),
|
|
||||||
# RelLib.Event.DEATH : _("Death"),
|
|
||||||
# RelLib.Event.ADULT_CHRISTEN : _("Adult Christening"),
|
|
||||||
# RelLib.Event.BAPTISM : _("Baptism"),
|
|
||||||
# RelLib.Event.BAR_MITZVAH : _("Bar Mitzvah"),
|
|
||||||
# RelLib.Event.BAS_MITZVAH : _("Bas Mitzvah"),
|
|
||||||
# RelLib.Event.BLESS : _("Blessing"),
|
|
||||||
# RelLib.Event.BURIAL : _("Burial"),
|
|
||||||
# RelLib.Event.CAUSE_DEATH : _("Cause Of Death"),
|
|
||||||
# RelLib.Event.CENSUS : _("Census"),
|
|
||||||
# RelLib.Event.CHRISTEN : _("Christening"),
|
|
||||||
# RelLib.Event.CONFIRMATION : _("Confirmation"),
|
|
||||||
# RelLib.Event.CREMATION : _("Cremation"),
|
|
||||||
# RelLib.Event.DEGREE : _("Degree"),
|
|
||||||
# RelLib.Event.DIV_FILING : _("Divorce Filing"),
|
|
||||||
# RelLib.Event.EDUCATION : _("Education"),
|
|
||||||
# RelLib.Event.ELECTED : _("Elected"),
|
|
||||||
# RelLib.Event.EMIGRATION : _("Emigration"),
|
|
||||||
# RelLib.Event.FIRST_COMMUN : _("First Communion"),
|
|
||||||
# RelLib.Event.IMMIGRATION : _("Immigration"),
|
|
||||||
# RelLib.Event.GRADUATION : _("Graduation"),
|
|
||||||
# RelLib.Event.MED_INFO : _("Medical Information"),
|
|
||||||
# RelLib.Event.MILITARY_SERV : _("Military Service"),
|
|
||||||
# RelLib.Event.NATURALIZATION : _("Naturalization"),
|
|
||||||
# RelLib.Event.NOB_TITLE : _("Nobility Title"),
|
|
||||||
# RelLib.Event.NUM_MARRIAGES : _("Number of Marriages"),
|
|
||||||
# RelLib.Event.OCCUPATION : _("Occupation"),
|
|
||||||
# RelLib.Event.ORDINATION : _("Ordination"),
|
|
||||||
# RelLib.Event.PROBATE : _("Probate"),
|
|
||||||
# RelLib.Event.PROPERTY : _("Property"),
|
|
||||||
# RelLib.Event.RELIGION : _("Religion"),
|
|
||||||
# RelLib.Event.RESIDENCE : _("Residence"),
|
|
||||||
# RelLib.Event.RETIREMENT : _("Retirement"),
|
|
||||||
# RelLib.Event.WILL : _("Will")
|
|
||||||
# }
|
|
||||||
# def format_personal_event( type):
|
|
||||||
# if type[0] == RelLib.Event.CUSTOM:
|
|
||||||
# return type[1]
|
|
||||||
# return personal_events.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
# def format_event( type):
|
|
||||||
# if type[0] == RelLib.Event.CUSTOM:
|
|
||||||
# return type[1]
|
|
||||||
# val = personal_events.get(type[0])
|
|
||||||
# if not val:
|
|
||||||
# val = family_events.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
# return val
|
|
||||||
|
|
||||||
personal_attributes = {
|
personal_attributes = {
|
||||||
RelLib.Attribute.UNKNOWN : _("Unknown"),
|
RelLib.Attribute.UNKNOWN : _("Unknown"),
|
||||||
@@ -185,18 +115,6 @@ def format_attribute( type):
|
|||||||
val = family_attributes.get(type[0],_("Invalid id %d ('%s')")%type)
|
val = family_attributes.get(type[0],_("Invalid id %d ('%s')")%type)
|
||||||
return val
|
return val
|
||||||
|
|
||||||
## family_relations = {
|
|
||||||
## RelLib.Family.MARRIED : _("Married"),
|
|
||||||
## RelLib.Family.UNMARRIED : _("Unmarried"),
|
|
||||||
## RelLib.Family.CIVIL_UNION : _("Civil Union"),
|
|
||||||
## RelLib.Family.UNKNOWN : _("Unknown"),
|
|
||||||
## RelLib.Family.CUSTOM : _("Other"),
|
|
||||||
## }
|
|
||||||
## def format_family_relation( type):
|
|
||||||
## if type[0] == RelLib.Family.CUSTOM:
|
|
||||||
## return type[1]
|
|
||||||
## return family_relations.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
family_rel_descriptions = {
|
family_rel_descriptions = {
|
||||||
RelLib.FamilyRelType.MARRIED : _("A legal or common-law relationship "
|
RelLib.FamilyRelType.MARRIED : _("A legal or common-law relationship "
|
||||||
"between a husband and wife"),
|
"between a husband and wife"),
|
||||||
@@ -210,91 +128,6 @@ family_rel_descriptions = {
|
|||||||
"a man and woman"),
|
"a man and woman"),
|
||||||
}
|
}
|
||||||
|
|
||||||
## source_media_types = {
|
|
||||||
## RelLib.RepoRef.UNKNOWN : _("Unknown"),
|
|
||||||
## RelLib.RepoRef.CUSTOM : _("Custom"),
|
|
||||||
## RelLib.RepoRef.AUDIO : _("Audio"),
|
|
||||||
## RelLib.RepoRef.BOOK : _("Book"),
|
|
||||||
## RelLib.RepoRef.CARD : _("Card"),
|
|
||||||
## RelLib.RepoRef.ELECTRONIC : _("Electronic"),
|
|
||||||
## RelLib.RepoRef.FICHE : _("Fiche"),
|
|
||||||
## RelLib.RepoRef.FILM : _("Film"),
|
|
||||||
## RelLib.RepoRef.MAGAZINE : _("Magazine"),
|
|
||||||
## RelLib.RepoRef.MANUSCRIPT : _("Manuscript"),
|
|
||||||
## RelLib.RepoRef.MAP : _("Map"),
|
|
||||||
## RelLib.RepoRef.NEWSPAPER : _("Newspaper"),
|
|
||||||
## RelLib.RepoRef.PHOTO : _("Photo"),
|
|
||||||
## RelLib.RepoRef.TOMBSTONE : _("Tombstone"),
|
|
||||||
## RelLib.RepoRef.VIDEO : _("Video"),
|
|
||||||
## }
|
|
||||||
## def format_source_media_type( type):
|
|
||||||
## if type[0] == RelLib.RepoRef.CUSTOM:
|
|
||||||
## return type[1]
|
|
||||||
## return source_media_types.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
## event_roles = {
|
|
||||||
## RelLib.EventRef.UNKNOWN : _("Unknown"),
|
|
||||||
## RelLib.EventRef.CUSTOM : _("Custom"),
|
|
||||||
## RelLib.EventRef.PRIMARY : _("Primary"),
|
|
||||||
## RelLib.EventRef.CLERGY : _("Clergy"),
|
|
||||||
## RelLib.EventRef.CELEBRANT : _("Celebrant"),
|
|
||||||
## RelLib.EventRef.AIDE : _("Aide"),
|
|
||||||
## RelLib.EventRef.BRIDE : _("Bride"),
|
|
||||||
## RelLib.EventRef.GROOM : _("Groom"),
|
|
||||||
## RelLib.EventRef.WITNESS : _("Witness"),
|
|
||||||
## }
|
|
||||||
## def format_personal_event_role( type):
|
|
||||||
## if type[0] == RelLib.EventRef.CUSTOM:
|
|
||||||
## return type[1]
|
|
||||||
## return event_roles.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
## family_event_roles = {
|
|
||||||
## RelLib.EventRef.UNKNOWN : _("Unknown"),
|
|
||||||
## RelLib.EventRef.CUSTOM : _("Custom"),
|
|
||||||
## RelLib.EventRef.FAMILY : _("Family"),
|
|
||||||
## }
|
|
||||||
## def format_family_event_role( type):
|
|
||||||
## if type[0] == RelLib.EventRef.CUSTOM:
|
|
||||||
## return type[1]
|
|
||||||
## return family_event_roles.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
## def format_event_role( type):
|
|
||||||
## if type[0] == RelLib.EventRef.CUSTOM:
|
|
||||||
## return type[1]
|
|
||||||
## val = event_roles.get(type[0])
|
|
||||||
## if not val:
|
|
||||||
## val = family_event_roles.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
## return val
|
|
||||||
|
|
||||||
# repository_types = {
|
|
||||||
# RelLib.Repository.UNKNOWN : _("Unknown"),
|
|
||||||
# RelLib.Repository.CUSTOM : _("Custom"),
|
|
||||||
# RelLib.Repository.LIBRARY : _("Library"),
|
|
||||||
# RelLib.Repository.CEMETERY : _("Cemetery"),
|
|
||||||
# RelLib.Repository.CHURCH : _("Church"),
|
|
||||||
# RelLib.Repository.ARCHIVE : _("Archive"),
|
|
||||||
# RelLib.Repository.ALBUM : _("Album"),
|
|
||||||
# RelLib.Repository.WEBSITE : _("Web site"),
|
|
||||||
# RelLib.Repository.BOOKSTORE : _("Bookstore"),
|
|
||||||
# RelLib.Repository.COLLECTION : _("Collection"),
|
|
||||||
# RelLib.Repository.SAFE : _("Safe"),
|
|
||||||
# }
|
|
||||||
# def format_repository_type( type):
|
|
||||||
# if type[0] == RelLib.Repository.CUSTOM:
|
|
||||||
# return type[1]
|
|
||||||
# return repository_types.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
|
|
||||||
## marker_types = {
|
|
||||||
## RelLib.PrimaryObject.MARKER_NONE : "",
|
|
||||||
## RelLib.PrimaryObject.MARKER_CUSTOM : _("Custom"),
|
|
||||||
## RelLib.PrimaryObject.MARKER_COMPLETE : _("Information is complete"),
|
|
||||||
## RelLib.PrimaryObject.MARKER_TODO : _("TODO"),
|
|
||||||
## }
|
|
||||||
## def format_marker_type( type):
|
|
||||||
## if type[0] == RelLib.PrimaryObject.MARKER_CUSTOM:
|
|
||||||
## return type[1]
|
|
||||||
## return marker_types.get(type[0],_("Invalid id %d ('%s')")%type)
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user