pychecker fixes

svn: r6407
This commit is contained in:
Don Allingham
2006-04-22 03:23:57 +00:00
parent 489c2c5c63
commit d384497dd9
22 changed files with 39 additions and 57 deletions

View File

@@ -77,9 +77,6 @@ class EditAttribute(EditSecondary):
self.alist = data_list
EditSecondary.__init__(self, state, uistate, track, attrib, callback)
def attribute_list(self):
return Utils.personal_attributes
def _local_init(self):
self.top = gtk.glade.XML(const.gladeFile, "attr_edit","gramps")
self.define_top_level(self.top.get_widget("attr_edit"),
@@ -120,8 +117,8 @@ class EditAttribute(EditSecondary):
self.obj.get_note_object()))
notebook.show_all()
vbox = self.top.get_widget('vbox').pack_start(notebook,True)
self.top.get_widget('vbox').pack_start(notebook,True)
def build_menu_names(self, attrib):
if not attrib:
label = _("New Attribute")
@@ -162,7 +159,4 @@ class EditFamilyAttribute(EditAttribute):
"""
EditAttribute.__init__(self, state, uistate, track, attrib, title,
data_list, callback)
def attribute_list(self):
return Utils.family_attributes

View File

@@ -212,7 +212,7 @@ class EditEvent(EditPrimary):
if self.callback:
self.callback(self.obj)
self.close(obj)
self.close()
def data_has_changed(self):
if self.db.readonly:

View File

@@ -221,9 +221,6 @@ class EditFamilyEventRef(EditEventRef):
self.commit_event = self.db.commit_family_event
self.add_event = self.db.add_family_event
def get_roles(self):
return Utils.event_roles
def get_custom_events(self):
return [ RelLib.EventType((RelLib.EventType.CUSTOM,val)) \
for val in self.dbstate.db.get_family_event_types()]

View File

@@ -212,7 +212,7 @@ class EditLdsOrd(EditSecondary):
self.obj.get_note_object()))
notebook.show_all()
vbox = self.top.get_widget('vbox').pack_start(notebook,True)
self.top.get_widget('vbox').pack_start(notebook,True)
def select_parents_clicked(self, obj):
from SelectFamily import SelectFamily
@@ -380,7 +380,7 @@ class EditFamilyLdsOrd(EditSecondary):
self.obj.get_note_object()))
notebook.show_all()
vbox = self.top.get_widget('vbox').pack_start(notebook,True)
self.top.get_widget('vbox').pack_start(notebook,True)
def build_menu_names(self, attrib):
label = _("LDS Ordinance")

View File

@@ -108,5 +108,5 @@ class EditLocation(EditSecondary):
def save(self,*obj):
if self.callback:
self.callback(self.obj)
self.close(obj)
self.close()

View File

@@ -46,7 +46,6 @@ import Utils
import RelLib
import Mime
import ImgManip
import DisplayState
import GrampsDisplay
from DisplayTabs import *

View File

@@ -205,7 +205,7 @@ class EditPlace(EditPrimary):
self.db.transaction_commit(trans,
_("Edit Place (%s)") % self.obj.get_title())
self.close(obj)
self.close()
#-------------------------------------------------------------------------
#

View File

@@ -137,6 +137,7 @@ class EditReference(ManagedWindow.ManagedWindow):
button.connect('clicked',self.close_window)
def define_help_button(self,button,tag):
import GrampsDisplay
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
def _cleanup_on_exit(self):

View File

@@ -48,7 +48,6 @@ import gtk.glade
import const
import Utils
import RelLib
import DisplayState
from DisplayTabs import *
from GrampsWidgets import *
@@ -86,24 +85,29 @@ class EditRepoRef(EditReference):
self.source_ref.get_call_number, False)
self.gid = MonitoredEntry(
self.top.get_widget('gid'), self.source.set_gramps_id,
self.source.get_gramps_id,False)
self.top.get_widget('gid'),
self.source.set_gramps_id,
self.source.get_gramps_id,
False)
self.title = MonitoredEntry(
self.top.get_widget('repo_name'), self.source.set_name,
self.source.get_name,False)
self.top.get_widget('repo_name'),
self.source.set_name,
self.source.get_name,
False)
self.type_selector = MonitoredType(
self.top.get_widget("media_type"),
self.source_ref.set_media_type, self.source_ref.get_media_type,
self.source_ref.set_media_type,
self.source_ref.get_media_type,
dict(Utils.source_media_types),
RelLib.RepoRef.CUSTOM)
self.media_type_selector = MonitoredType(
self.media_type_selector = MonitoredDataType(
self.top.get_widget("repo_type"),
self.source.set_type, self.source.get_type,
dict(Utils.repository_types),
RelLib.Repository.CUSTOM)
self.source.set_type,
self.source.get_type
)
def _create_tabbed_pages(self):
"""

View File

@@ -126,13 +126,12 @@ class EditRepository(EditPrimary):
trans = self.db.transaction_begin()
if self.obj.get_handle() == None:
handle = self.db.add_repository(self.obj,trans)
self.db.add_repository(self.obj,trans)
else:
self.db.commit_repository(self.obj,trans)
handle = self.obj.get_handle()
msg = _("Edit Repository (%s)") % self.obj.get_name()
self.db.transaction_commit(trans,msg)
self.close(obj)
self.close()
class DelRepositoryQuery:
def __init__(self,repository,db,sources):

View File

@@ -152,6 +152,8 @@ class EditSource(EditPrimary):
def save(self,*obj):
if self.object_is_empty():
from QuestionDialog import ErrorDialog
ErrorDialog(_("Cannot save source"),
_("No data exists for this source. Please "
"enter data or cancel the edit."))
@@ -164,7 +166,7 @@ class EditSource(EditPrimary):
self.db.commit_source(self.obj,trans)
self.db.transaction_commit(trans,
_("Edit Source (%s)") % self.obj.get_title())
self.close(obj)
self.close()
class DelSrcQuery:
def __init__(self,source,db,the_lists):

View File

@@ -42,7 +42,6 @@ import gtk.glade
#-------------------------------------------------------------------------
import const
import Utils
import RelLib
from _EditSecondary import EditSecondary
from GrampsWidgets import *