From 6fbe1c9e70d715dc9f8768aac71c11e2d46edbf3 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 22 Apr 2006 04:00:58 +0000 Subject: [PATCH] pychecker fixes svn: r6409 --- gramps2/src/Editors/_EditFamily.py | 25 +++++++++---------------- gramps2/src/Editors/_EditMediaRef.py | 1 - gramps2/src/Editors/_EditRepoRef.py | 7 +++---- gramps2/src/Editors/_EditSourceRef.py | 1 - gramps2/src/SelectPerson.py | 5 +---- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/gramps2/src/Editors/_EditFamily.py b/gramps2/src/Editors/_EditFamily.py index 4e1ded042..5f19abcd1 100644 --- a/gramps2/src/Editors/_EditFamily.py +++ b/gramps2/src/Editors/_EditFamily.py @@ -77,7 +77,7 @@ from DdTargets import DdTargets from DisplayTabs import * from GrampsWidgets import * -from ObjectSelector import PersonSelector,PersonFilterSpec +#from ObjectSelector import PersonSelector,PersonFilterSpec from SelectPerson import SelectPerson @@ -110,7 +110,7 @@ class ChildEmbedList(EmbeddedList): (_('Death Place'),7), ] - def __init__(self,dbstate,uistate,track,family): + def __init__(self, dbstate, uistate, track, family): """ Create the object, storing the passed family value """ @@ -216,15 +216,12 @@ class ChildEmbedList(EmbeddedList): self.rebuild() def share_button_clicked(self,obj): - from SelectPerson import SelectPerson - # it only makes sense to skip those who are already in the family - skip = [self.family.get_father_handle(), self.family.get_mother_handle()] + \ - [x.ref for x in self.family.get_child_ref_list() ] + skip_list = [self.family.get_father_handle(), self.family.get_mother_handle()] + \ + [x.ref for x in self.family.get_child_ref_list() ] - sel = SelectPerson(self.dbstate.db, "Select Child", - skip=[ x for x in skip if x]) + sel = SelectPerson(self.dbstate.db, "Select Child", skip=skip_list) person = sel.run() if person: @@ -234,8 +231,8 @@ class ChildEmbedList(EmbeddedList): self.rebuild() def run(self,skip): - SelectPerson(self.dbstate.db, "Select Child", - skip=[ x for x in skip if x]) + skip_list = [ x for x in skip if x] + SelectPerson(self.dbstate.db, "Select Child", skip=skip_list) def del_button_clicked(self,obj): handle = self.get_selected() @@ -273,8 +270,8 @@ class ChildEmbedList(EmbeddedList): mother_handle = self.family.get_mother_handle() if not father_handle or not mother_handle: return ("","") - father = self.db.db.get_person_from_handle(father_handle) - mother = self.db.db.get_person_from_handle(mother_handle) + father = self.dbstate.db.get_person_from_handle(father_handle) + mother = self.dbstate.db.get_person_from_handle(mother_handle) fsn = father.get_primary_name().get_surname() msn = mother.get_primary_name().get_surname() if not father or not mother: @@ -522,8 +519,6 @@ class EditFamily(EditPrimary): self.obj.set_mother_handle(None) self.update_mother(None) else: - from SelectPerson import SelectPerson - data_filter = FastFemaleFilter(self.dbstate.db) sel = SelectPerson(self.dbstate.db, "Select Mother", filter=data_filter, @@ -593,8 +588,6 @@ class EditFamily(EditPrimary): self.obj.set_father_handle(None) self.update_father(None) else: - from SelectPerson import SelectPerson - data_filter = FastMaleFilter(self.dbstate.db) sel = SelectPerson(self.dbstate.db, "Select Father", filter=data_filter, diff --git a/gramps2/src/Editors/_EditMediaRef.py b/gramps2/src/Editors/_EditMediaRef.py index 8c25858f7..1bbd73344 100644 --- a/gramps2/src/Editors/_EditMediaRef.py +++ b/gramps2/src/Editors/_EditMediaRef.py @@ -46,7 +46,6 @@ import Utils import RelLib import Mime import ImgManip -import GrampsDisplay from DisplayTabs import * from GrampsWidgets import * diff --git a/gramps2/src/Editors/_EditRepoRef.py b/gramps2/src/Editors/_EditRepoRef.py index b2c28493a..d15665b0e 100644 --- a/gramps2/src/Editors/_EditRepoRef.py +++ b/gramps2/src/Editors/_EditRepoRef.py @@ -96,12 +96,11 @@ class EditRepoRef(EditReference): self.source.get_name, False) - self.type_selector = MonitoredType( + self.type_selector = MonitoredDataType( self.top.get_widget("media_type"), self.source_ref.set_media_type, - self.source_ref.get_media_type, - dict(Utils.source_media_types), - RelLib.RepoRef.CUSTOM) + self.source_ref.get_media_type + ) self.media_type_selector = MonitoredDataType( self.top.get_widget("repo_type"), diff --git a/gramps2/src/Editors/_EditSourceRef.py b/gramps2/src/Editors/_EditSourceRef.py index 18f47aeee..05f7a1694 100644 --- a/gramps2/src/Editors/_EditSourceRef.py +++ b/gramps2/src/Editors/_EditSourceRef.py @@ -48,7 +48,6 @@ import gtk.glade import const import Utils import RelLib -import DisplayState from DisplayTabs import * from GrampsWidgets import * diff --git a/gramps2/src/SelectPerson.py b/gramps2/src/SelectPerson.py index be46f46fc..8f7e0b2c6 100644 --- a/gramps2/src/SelectPerson.py +++ b/gramps2/src/SelectPerson.py @@ -52,7 +52,7 @@ import PeopleModel #------------------------------------------------------------------------- class SelectPerson: - def __init__(self, db, title, filter=None, skip=[], parent_window=None): + def __init__(self, db, title, filter=None, skip=[]): self.renderer = gtk.CellRendererText() self.renderer.set_property('ellipsize',pango.ELLIPSIZE_END) @@ -84,9 +84,6 @@ class SelectPerson: self.plist.set_model(self.model) self.top.show() - if parent_window: - self.top.set_transient_for(parent_window) - def foo(self): PeopleModel.PeopleModel(self.db)