pychecker cleanup

svn: r1254
This commit is contained in:
Don Allingham 2003-01-12 05:22:21 +00:00
parent f36b5c5056
commit a5b4fcd791
5 changed files with 26 additions and 34 deletions

View File

@ -23,6 +23,7 @@
# GTK/Gnome modules # GTK/Gnome modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gtk
import gtk.glade import gtk.glade
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -123,7 +123,6 @@ class StyleListDisplay:
if not iter: if not iter:
return return
name = self.list.model.get_value(iter,0) name = self.list.model.get_value(iter,0)
style = self.sheetlist.get_style_sheet(name)
self.sheetlist.delete_style_sheet(name) self.sheetlist.delete_style_sheet(name)
self.redraw() self.redraw()

View File

@ -102,7 +102,7 @@ class ReadTarFile:
return map return map
self.f.read(24) # modes self.f.read(24) # modes
l = string.replace(self.f.read(12),chr(0),' ') l = string.replace(self.f.read(12),chr(0),' ')
length = string.atoi(l,8) length = int(l,8)
self.f.read(12) self.f.read(12)
self.f.read(6) self.f.read(6)
self.f.read(111) self.f.read(111)
@ -136,7 +136,7 @@ class ReadTarFile:
for char in l: for char in l:
if ord(char) != 0: if ord(char) != 0:
length_string = length_string + char length_string = length_string + char
length = string.atoi(length_string,8) length = int(length_string,8)
self.f.read(12) self.f.read(12)
self.f.read(6) self.f.read(6)
self.f.read(111) self.f.read(111)

View File

@ -62,7 +62,6 @@ __version__ = "Revision:$"
# standard python modules # standard python modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import string
import os import os
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -102,9 +101,9 @@ def cnv2color(text):
converts a hex value in the form of #XXXXXX into a tuple of integers converts a hex value in the form of #XXXXXX into a tuple of integers
representing the RGB values representing the RGB values
""" """
c0 = string.atoi(text[1:3],16) c0 = int(text[1:3],16)
c1 = string.atoi(text[3:5],16) c1 = int(text[3:5],16)
c2 = string.atoi(text[5:7],16) c2 = int(text[5:7],16)
return (c0,c1,c2) return (c0,c1,c2)
#------------------------------------------------------------------------ #------------------------------------------------------------------------

View File

@ -49,12 +49,13 @@ import gtk.glade
# gramps modules # gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from RelLib import * #from RelLib import *
from PedView import PedigreeView import RelLib
from PlaceView import PlaceView import PedView
from SourceView import SourceView import MediaView
from MediaView import MediaView import PlaceView
from FamilyView import FamilyView import FamilyView
import SourceView
from QuestionDialog import QuestionDialog, ErrorDialog, WarningDialog from QuestionDialog import QuestionDialog, ErrorDialog, WarningDialog
@ -62,21 +63,18 @@ import DisplayTrace
import Filter import Filter
import const import const
import Plugins import Plugins
import sort
import Utils import Utils
import Bookmarks import Bookmarks
import GrampsCfg import GrampsCfg
import EditPerson import EditPerson
import Marriage
import Find import Find
import VersionControl import VersionControl
import ReadXML import ReadXML
import AddSpouse
import ListModel import ListModel
import GrampsXML
from GrampsXML import GrampsXML
try: try:
from GrampsZODB import GrampsZODB import GrampsZODB
zodb_ok = 1 zodb_ok = 1
except: except:
zodb_ok = 0 zodb_ok = 0
@ -124,7 +122,7 @@ class Gramps:
# This will never contain data - It will be replaced by either # This will never contain data - It will be replaced by either
# a GrampsXML or GrampsZODB # a GrampsXML or GrampsZODB
self.db = GrampsDB() self.db = RelLib.GrampsDB()
self.db.set_iprefix(GrampsCfg.iprefix) self.db.set_iprefix(GrampsCfg.iprefix)
self.db.set_oprefix(GrampsCfg.oprefix) self.db.set_oprefix(GrampsCfg.oprefix)
self.db.set_fprefix(GrampsCfg.fprefix) self.db.set_fprefix(GrampsCfg.fprefix)
@ -237,16 +235,16 @@ class Gramps:
self.toolbar.set_style(GrampsCfg.toolbar) self.toolbar.set_style(GrampsCfg.toolbar)
self.notebook.set_show_tabs(0) self.notebook.set_show_tabs(0)
self.family_view = FamilyView(self) self.family_view = FamilyView.FamilyView(self)
self.pedigree_view = PedigreeView( self.pedigree_view = PedView.PedigreeView(
self.canvas, self.modify_statusbar, self.statusbar, self.canvas, self.modify_statusbar, self.statusbar,
self.change_active_person, self.load_person self.change_active_person, self.load_person
) )
self.place_view = PlaceView(self.db,self.gtop,self.update_display) self.place_view = PlaceView.PlaceView(self.db,self.gtop,self.update_display)
self.source_view = SourceView(self.db,self.gtop,self.update_display) self.source_view = SourceView.SourceView(self.db,self.gtop,self.update_display)
self.media_view = MediaView(self.db,self.gtop,self.update_display) self.media_view = MediaView.MediaView(self.db,self.gtop,self.update_display)
self.addbtn = self.gtop.get_widget('addbtn') self.addbtn = self.gtop.get_widget('addbtn')
self.removebtn = self.gtop.get_widget('removebtn') self.removebtn = self.gtop.get_widget('removebtn')
@ -543,9 +541,6 @@ class Gramps:
url = "gnome-help:"+url url = "gnome-help:"+url
gnome.help.goto(url) gnome.help.goto(url)
def add_new_cancel(self,obj):
Utils.destroy_passed_object(self.addornew)
def on_new_clicked(self,obj): def on_new_clicked(self,obj):
"""Prompt for permission to close the current database""" """Prompt for permission to close the current database"""
@ -577,11 +572,11 @@ class Gramps:
self.person_model = self.pl_page[-1].model self.person_model = self.pl_page[-1].model
if zodb == 1: if zodb == 1:
self.db = GrampsZODB() self.db = GrampsZODB.GrampsZODB()
elif zodb == 2: elif zodb == 2:
self.db = GrampsDB() self.db = RelLib.GrampsDB()
else: else:
self.db = GrampsXML() self.db = GrampsXML.GrampsXML()
self.db.set_iprefix(GrampsCfg.iprefix) self.db.set_iprefix(GrampsCfg.iprefix)
self.db.set_oprefix(GrampsCfg.oprefix) self.db.set_oprefix(GrampsCfg.oprefix)
self.db.set_fprefix(GrampsCfg.fprefix) self.db.set_fprefix(GrampsCfg.fprefix)
@ -818,7 +813,7 @@ class Gramps:
self.load_person(self.active_person) self.load_person(self.active_person)
def load_new_person(self,obj): def load_new_person(self,obj):
self.active_person = Person() self.active_person = RelLib.Person()
try: try:
EditPerson.EditPerson(self.active_person,self.db, EditPerson.EditPerson(self.active_person,self.db,
self.new_after_edit) self.new_after_edit)
@ -875,7 +870,7 @@ class Gramps:
del self.id2col[del_id] del self.id2col[del_id]
if person == self.active_person: if person == self.active_person:
self.active_person == None self.active_person = None
def merge_update(self,p1,p2,old_id): def merge_update(self,p1,p2,old_id):
self.remove_from_person_list(p1,old_id) self.remove_from_person_list(p1,old_id)
@ -1126,7 +1121,6 @@ class Gramps:
iter = model.add([val[0],val[1],val[2],val[3],val[4],val[5], iter = model.add([val[0],val[1],val[2],val[3],val[4],val[5],
val[6],val[7]],key) val[6],val[7]],key)
page = self.model2page[model]
self.id2col[key] = (model,iter) self.id2col[key] = (model,iter)
if change: if change:
@ -1297,7 +1291,6 @@ class Gramps:
iter = model.add([val[0],val[1],val[2],val[3],val[4],val[5], iter = model.add([val[0],val[1],val[2],val[3],val[4],val[5],
val[6],val[7]],key) val[6],val[7]],key)
page = self.model2page[model]
self.id2col[key] = (model,iter) self.id2col[key] = (model,iter)
else: else:
if self.id2col.has_key(key): if self.id2col.has_key(key):