gramps/src/ObjectSelector/_Factories.py

15 lines
397 B
Python
Raw Normal View History

from _Constants import ObjectTypes
from _PersonFrame import PersonFrame
from _FamilyFrame import FamilyFrame
class ObjectFrameFactory(object):
__frame_creators = {ObjectTypes.PERSON: PersonFrame,
ObjectTypes.FAMILY: FamilyFrame}
def get_frame(self,object_type,dbstate,uistate):
return self.__class__.__frame_creators[object_type](dbstate,uistate)