From b30254c69531198a8d4d1ee0129d5d789c6d5e00 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 10 Jan 2003 13:52:32 +0000 Subject: [PATCH] Pychecker fixes, gnome.url.show to gnome.url_show svn: r1252 --- gramps2/src/gramps_main.py | 13 ++++++------ gramps2/src/plugins/ChangeTypes.py | 1 - gramps2/src/plugins/Check.py | 1 - gramps2/src/plugins/Desbrowser.py | 1 - gramps2/src/plugins/FilterEditor.py | 2 -- gramps2/src/plugins/PatchNames.py | 2 -- gramps2/src/plugins/RelCalc.py | 1 - gramps2/src/plugins/Summary.py | 4 ++-- gramps2/src/plugins/Verify.py | 31 +++++++++-------------------- gramps2/src/plugins/WritePkg.py | 2 -- gramps2/src/plugins/count_anc.py | 1 - gramps2/src/plugins/soundgen.py | 2 -- 12 files changed, 18 insertions(+), 43 deletions(-) diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 52e5d4852..c65dc56f9 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -86,6 +86,10 @@ except: # Constants # #------------------------------------------------------------------------- +_HOMEPAGE = "http://gramps.sourceforge.net" +_MAILLIST = "http://sourceforge.net/mail/?group_id=25770" +_BUGREPORT = "http://sourceforge.net/tracker/?group_id=25770&atid=385137" + pl_titles = [ (_('Name'),5,250), (_('ID'),1,50),(_('Gender'),2,70), (_('Birth Date'),6,150),(_('Death Date'),7,150), ('',5,0), ('',6,0), ('',7,0) ] @@ -455,16 +459,13 @@ class Gramps: self.media_view.moveto(row) def on_gramps_home_page_activate(self,obj): - import gnome.url - gnome.url.show("http://gramps.sourceforge.net") + gnome.url_show(_HOMEPAGE) def on_gramps_mailing_lists_activate(self,obj): - import gnome.url - gnome.url.show("http://sourceforge.net/mail/?group_id=25770") + gnome.url_show(_MAILLIST) def on_gramps_report_bug_activate(self,obj): - import gnome.url - gnome.url.show("http://sourceforge.net/tracker/?group_id=25770&atid=385137") + gnome.url_show(_BUGREPORT) def on_merge_activate(self,obj): """Calls up the merge dialog for the selection""" diff --git a/gramps2/src/plugins/ChangeTypes.py b/gramps2/src/plugins/ChangeTypes.py index b74a0a33e..6bce6524c 100644 --- a/gramps2/src/plugins/ChangeTypes.py +++ b/gramps2/src/plugins/ChangeTypes.py @@ -22,7 +22,6 @@ import os -import gnome.ui import gtk import gtk.glade diff --git a/gramps2/src/plugins/Check.py b/gramps2/src/plugins/Check.py index b02b88be2..d213bbe6c 100644 --- a/gramps2/src/plugins/Check.py +++ b/gramps2/src/plugins/Check.py @@ -26,7 +26,6 @@ from intl import gettext as _ import os -import gnome.ui import gtk import gtk.glade from QuestionDialog import OkDialog diff --git a/gramps2/src/plugins/Desbrowser.py b/gramps2/src/plugins/Desbrowser.py index d4b7733df..c75c2f46b 100644 --- a/gramps2/src/plugins/Desbrowser.py +++ b/gramps2/src/plugins/Desbrowser.py @@ -32,7 +32,6 @@ import os # GRAMPS modules # #------------------------------------------------------------------------ -from RelLib import * import Utils from intl import gettext as _ import GrampsCfg diff --git a/gramps2/src/plugins/FilterEditor.py b/gramps2/src/plugins/FilterEditor.py index 99891fcb2..3aabcef52 100644 --- a/gramps2/src/plugins/FilterEditor.py +++ b/gramps2/src/plugins/FilterEditor.py @@ -23,13 +23,11 @@ __author__ = "Don Allingham" import gtk -import gnome.ui import gtk.glade import string import os import const -from RelLib import * import GenericFilter import AutoComp import ListModel diff --git a/gramps2/src/plugins/PatchNames.py b/gramps2/src/plugins/PatchNames.py index df1b6756c..3e829c015 100644 --- a/gramps2/src/plugins/PatchNames.py +++ b/gramps2/src/plugins/PatchNames.py @@ -28,8 +28,6 @@ from intl import gettext as _ import gtk import gtk.glade -import gnome.ui -from QuestionDialog import OkDialog _title_re = re.compile(r"^([A-Za-z][A-Za-z]+\.)\s+(.*)$") _nick_re = re.compile(r"(.+)[(\"](.*)[)\"]") diff --git a/gramps2/src/plugins/RelCalc.py b/gramps2/src/plugins/RelCalc.py index 564e47f2e..8198769ce 100644 --- a/gramps2/src/plugins/RelCalc.py +++ b/gramps2/src/plugins/RelCalc.py @@ -43,7 +43,6 @@ import gtk.glade #------------------------------------------------------------------------- import RelLib -import sort import Utils import ListModel from intl import gettext as _ diff --git a/gramps2/src/plugins/Summary.py b/gramps2/src/plugins/Summary.py index 88b03097d..364f66feb 100644 --- a/gramps2/src/plugins/Summary.py +++ b/gramps2/src/plugins/Summary.py @@ -33,8 +33,8 @@ import posixpath # GRAMPS modules # #------------------------------------------------------------------------ -from RelLib import * import Utils +import RelLib from intl import gettext as _ #------------------------------------------------------------------------ @@ -95,7 +95,7 @@ def report(database,person): disconnected = disconnected + 1 if person.getBirth().getDate() == "": missing_bday = missing_bday + 1 - if person.getGender() == Person.female: + if person.getGender() == RelLib.Person.female: females = females + 1 else: males = males + 1 diff --git a/gramps2/src/plugins/Verify.py b/gramps2/src/plugins/Verify.py index 9d0cc8f20..aba06ab61 100644 --- a/gramps2/src/plugins/Verify.py +++ b/gramps2/src/plugins/Verify.py @@ -41,8 +41,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------ -from RelLib import * - +import RelLib import Utils from intl import gettext as _ @@ -81,21 +80,15 @@ def on_apply_clicked(obj): global verifySettings personList = db.getPersonMap().values() - familyList = db.getFamilyMap().values() oldage = int(verifySettings.get_widget("oldage").get_text()) - hwdif = int(verifySettings.get_widget("hwdif").get_text()) yngmar = int(verifySettings.get_widget("yngmar").get_text()) oldmar = int(verifySettings.get_widget("oldmar").get_text()) - fecmom = int(verifySettings.get_widget("fecmom").get_text()) oldmom = int(verifySettings.get_widget("oldmom").get_text()) yngmom = int(verifySettings.get_widget("yngmom").get_text()) - fecdad = int(verifySettings.get_widget("fecdad").get_text()) olddad = int(verifySettings.get_widget("olddad").get_text()) yngdad = int(verifySettings.get_widget("yngdad").get_text()) wedder = int(verifySettings.get_widget("wedder").get_text()) - cspace = int(verifySettings.get_widget("cspace").get_text()) - cbspan = int(verifySettings.get_widget("cbspan").get_text()) lngwdw = int(verifySettings.get_widget("lngwdw").get_text()) oldunm = 99 # maximum age at death for unmarried person @@ -141,31 +134,27 @@ def on_apply_clicked(obj): warn = "%sOld age %s born %d died %d age %d.\n" % (warn, idstr, byear, dyear, ageatdeath) # gender checks - if person.getGender() == Person.female: + if person.getGender() == RelLib.Person.female: parstr = "mother " oldpar = oldmom yngpar = yngmom - fecpar = fecmom waswidstr = " was a widow " - if person.getGender() == Person.male: + if person.getGender() == RelLib.Person.male: parstr = "father " oldpar = olddad yngpar = yngdad - fecpar = fecdad waswidstr = " was a widower " - if (person.getGender() != Person.female) and (person.getGender() != Person.male): + if (person.getGender() != RelLib.Person.female) and (person.getGender() != RelLib.Person.male): warn ="%sUnknown gender %s.\n" % (warn, idstr) parstr = "parent " oldpar = olddad yngpar = yngdad - fecpar = fecdad waswidstr = " was a widow " - if (person.getGender() == Person.female) and (person.getGender() == Person.male): + if (person.getGender() == RelLib.Person.female) and (person.getGender() == RelLib.Person.male): error ="%sAmbigous gender %s.\n" % (error, idstr) parstr = "parent " oldpar = olddad yngpar = yngdad - fecpar = fecdad waswidstr = " was a widow " # multiple parentage check @@ -182,8 +171,6 @@ def on_apply_clicked(obj): first_cbyear = 99999 last_cbyear=0 prev_cbyear=0 - prev_cbyfnum=0 - prev_cbyind=0 prev_maryear=0 prev_sdyear=0 fnum = 0 @@ -194,16 +181,16 @@ def on_apply_clicked(obj): if mother!=None and father!=None: if mother.getGender() == father.getGender(): warn = "%sHomosexual marriage %s family %s.\n" % (error, idstr, family.getId()) - if family.getFather() == person and person.getGender() == Person.female: + if family.getFather() == person and person.getGender() == RelLib.Person.female: error = "%sFemale husband %s family %s.\n" % (error, idstr, family.getId()) - if family.getMother() == person and person.getGender() == Person.male: + if family.getMother() == person and person.getGender() == RelLib.Person.male: error = "%sMale wife %s family %s.\n" % (error, idstr, family.getId()) if family.getFather() == person: spouse = family.getMother() else: spouse = family.getFather() if spouse != None: - if person.getGender() == Person.male and \ + if person.getGender() == RelLib.Person.male and \ person.getPrimaryName().getSurname() == spouse.getPrimaryName().getSurname(): warn = "%sHusband and wife with same surname %s family %s %s.\n" % ( warn, idstr,family.getId(), spouse.getPrimaryName().getName()) sdyear = get_year( spouse.getDeath() ) @@ -266,7 +253,7 @@ def on_apply_clicked(obj): if bage < yngpar: warn = "%sYoung %s %s age %d family %s child %s.\n" % (warn, parstr, idstr, bage, family.getId(), child.getPrimaryName().getName()) if dyear>0 and cbyear>dyear: - if person.getGender() == Person.male: + if person.getGender() == RelLib.Person.male: if cbyear-1>dyear: error = "%sDead %s %s died %d family %s child %s born %d.\n" % (error, parstr, idstr, dyear, family.getId(), child.getPrimaryName().getName(), cbyear) else: diff --git a/gramps2/src/plugins/WritePkg.py b/gramps2/src/plugins/WritePkg.py index 4a5d93af5..384c819ca 100644 --- a/gramps2/src/plugins/WritePkg.py +++ b/gramps2/src/plugins/WritePkg.py @@ -42,8 +42,6 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import * - import WriteXML import TarFile import Utils diff --git a/gramps2/src/plugins/count_anc.py b/gramps2/src/plugins/count_anc.py index 7f746cc18..7a7168725 100644 --- a/gramps2/src/plugins/count_anc.py +++ b/gramps2/src/plugins/count_anc.py @@ -20,7 +20,6 @@ "View/Number of ancestors" -from RelLib import * import os import Utils from intl import gettext as _ diff --git a/gramps2/src/plugins/soundgen.py b/gramps2/src/plugins/soundgen.py index 1e1296a81..0bac208e1 100644 --- a/gramps2/src/plugins/soundgen.py +++ b/gramps2/src/plugins/soundgen.py @@ -24,9 +24,7 @@ import os import gtk import gtk.glade -from gnome.ui import * -import RelLib import soundex import Utils from intl import gettext as _