diff --git a/gramps2/src/LocEdit.py b/gramps2/src/LocEdit.py index 102dd2a3c..33a32a8ed 100644 --- a/gramps2/src/LocEdit.py +++ b/gramps2/src/LocEdit.py @@ -23,6 +23,7 @@ # GTK/Gnome modules # #------------------------------------------------------------------------- +import gtk import gtk.glade #------------------------------------------------------------------------- diff --git a/gramps2/src/StyleEditor.py b/gramps2/src/StyleEditor.py index 7f8274307..c5d9d4e03 100644 --- a/gramps2/src/StyleEditor.py +++ b/gramps2/src/StyleEditor.py @@ -123,7 +123,6 @@ class StyleListDisplay: if not iter: return name = self.list.model.get_value(iter,0) - style = self.sheetlist.get_style_sheet(name) self.sheetlist.delete_style_sheet(name) self.redraw() diff --git a/gramps2/src/TarFile.py b/gramps2/src/TarFile.py index 972ec2491..0d736e5ee 100644 --- a/gramps2/src/TarFile.py +++ b/gramps2/src/TarFile.py @@ -102,7 +102,7 @@ class ReadTarFile: return map self.f.read(24) # modes 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(6) self.f.read(111) @@ -136,7 +136,7 @@ class ReadTarFile: for char in l: if ord(char) != 0: length_string = length_string + char - length = string.atoi(length_string,8) + length = int(length_string,8) self.f.read(12) self.f.read(6) self.f.read(111) diff --git a/gramps2/src/TextDoc.py b/gramps2/src/TextDoc.py index 5107af025..6e392baf5 100644 --- a/gramps2/src/TextDoc.py +++ b/gramps2/src/TextDoc.py @@ -62,7 +62,6 @@ __version__ = "Revision:$" # standard python modules # #------------------------------------------------------------------------- -import string import os #------------------------------------------------------------------------- @@ -102,9 +101,9 @@ def cnv2color(text): converts a hex value in the form of #XXXXXX into a tuple of integers representing the RGB values """ - c0 = string.atoi(text[1:3],16) - c1 = string.atoi(text[3:5],16) - c2 = string.atoi(text[5:7],16) + c0 = int(text[1:3],16) + c1 = int(text[3:5],16) + c2 = int(text[5:7],16) return (c0,c1,c2) #------------------------------------------------------------------------ diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index d0894835f..b96e8d47d 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -49,12 +49,13 @@ import gtk.glade # gramps modules # #------------------------------------------------------------------------- -from RelLib import * -from PedView import PedigreeView -from PlaceView import PlaceView -from SourceView import SourceView -from MediaView import MediaView -from FamilyView import FamilyView +#from RelLib import * +import RelLib +import PedView +import MediaView +import PlaceView +import FamilyView +import SourceView from QuestionDialog import QuestionDialog, ErrorDialog, WarningDialog @@ -62,21 +63,18 @@ import DisplayTrace import Filter import const import Plugins -import sort import Utils import Bookmarks import GrampsCfg import EditPerson -import Marriage import Find import VersionControl import ReadXML -import AddSpouse import ListModel +import GrampsXML -from GrampsXML import GrampsXML try: - from GrampsZODB import GrampsZODB + import GrampsZODB zodb_ok = 1 except: zodb_ok = 0 @@ -124,7 +122,7 @@ class Gramps: # This will never contain data - It will be replaced by either # a GrampsXML or GrampsZODB - self.db = GrampsDB() + self.db = RelLib.GrampsDB() self.db.set_iprefix(GrampsCfg.iprefix) self.db.set_oprefix(GrampsCfg.oprefix) self.db.set_fprefix(GrampsCfg.fprefix) @@ -237,16 +235,16 @@ class Gramps: self.toolbar.set_style(GrampsCfg.toolbar) 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.change_active_person, self.load_person ) - self.place_view = PlaceView(self.db,self.gtop,self.update_display) - self.source_view = SourceView(self.db,self.gtop,self.update_display) - self.media_view = MediaView(self.db,self.gtop,self.update_display) + self.place_view = PlaceView.PlaceView(self.db,self.gtop,self.update_display) + self.source_view = SourceView.SourceView(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.removebtn = self.gtop.get_widget('removebtn') @@ -543,9 +541,6 @@ class Gramps: url = "gnome-help:"+url gnome.help.goto(url) - def add_new_cancel(self,obj): - Utils.destroy_passed_object(self.addornew) - def on_new_clicked(self,obj): """Prompt for permission to close the current database""" @@ -577,11 +572,11 @@ class Gramps: self.person_model = self.pl_page[-1].model if zodb == 1: - self.db = GrampsZODB() + self.db = GrampsZODB.GrampsZODB() elif zodb == 2: - self.db = GrampsDB() + self.db = RelLib.GrampsDB() else: - self.db = GrampsXML() + self.db = GrampsXML.GrampsXML() self.db.set_iprefix(GrampsCfg.iprefix) self.db.set_oprefix(GrampsCfg.oprefix) self.db.set_fprefix(GrampsCfg.fprefix) @@ -818,7 +813,7 @@ class Gramps: self.load_person(self.active_person) def load_new_person(self,obj): - self.active_person = Person() + self.active_person = RelLib.Person() try: EditPerson.EditPerson(self.active_person,self.db, self.new_after_edit) @@ -875,7 +870,7 @@ class Gramps: del self.id2col[del_id] if person == self.active_person: - self.active_person == None + self.active_person = None def merge_update(self,p1,p2,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], val[6],val[7]],key) - page = self.model2page[model] self.id2col[key] = (model,iter) if change: @@ -1297,7 +1291,6 @@ class Gramps: iter = model.add([val[0],val[1],val[2],val[3],val[4],val[5], val[6],val[7]],key) - page = self.model2page[model] self.id2col[key] = (model,iter) else: if self.id2col.has_key(key):