diff --git a/ChangeLog b/ChangeLog index 8efc5ad32..17c821e61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2007-01-03 Don Allingham + * src/DataViews/_EventView.py: lint fixes + * src/DataViews/_PersonView.py: lint fixes + * src/RelLib/_Person.py: lint fixes + * src/RelLib/_PrimaryObject.py: lint fixes + * src/Selectors/_BaseSelector.py: lint fixes + * src/GrampsWidgets.py: lint fixes + * src/Spell.py: lint fixes + * src/PageView.py: lint fixes + * src/Filters/_SearchFilter.py: lint fixes + * src/Filters/SideBar/_MediaSidebarFilter.py: lint fixes + * src/Filters/SideBar/_SourceSidebarFilter.py: lint fixes + * src/Filters/SideBar/_EventSidebarFilter.py: lint fixes + * src/Filters/SideBar/_FamilySidebarFilter.py: lint fixes + * src/Filters/SideBar/_PlaceSidebarFilter.py: lint fixes + * src/Filters/SideBar/_RepoSidebarFilter.py: lint fixes + * src/Filters/SideBar/_PersonSidebarFilter.py: lint fixes + 2007-01-02 Don Allingham * src/GrampsDb/_WriteGedcom.py: handle illegal confidence * src/RelLib/_Person.py: set_parent_family_list diff --git a/src/DataViews/_EventView.py b/src/DataViews/_EventView.py index 27c686089..fb0bea459 100644 --- a/src/DataViews/_EventView.py +++ b/src/DataViews/_EventView.py @@ -19,13 +19,6 @@ # $Id$ -#------------------------------------------------------------------------- -# -# GTK/Gnome modules -# -#------------------------------------------------------------------------- -import gtk - #------------------------------------------------------------------------- # # gramps modules diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 4a96783f3..512136145 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -60,7 +60,7 @@ import Config import const from Editors import EditPerson -from Filters import SearchBar, SearchFilter +from Filters import SearchBar, SearchFilter, ExactSearchFilter from Filters.SideBar import PersonSidebarFilter from DdTargets import DdTargets @@ -155,8 +155,8 @@ class PersonView(PageView.PersonNavView): self.edit_action.set_visible(False) self.edit_action.set_sensitive(not self.dbstate.db.readonly) - def disable_action_group(self, obj): - PageView.PersonNavView.disable_action_group(self, obj) + def disable_action_group(self): + PageView.PersonNavView.disable_action_group(self) self.all_action.set_visible(False) self.edit_action.set_visible(False) diff --git a/src/Filters/SideBar/_EventSidebarFilter.py b/src/Filters/SideBar/_EventSidebarFilter.py index 3c3466c4b..b7a5636b8 100644 --- a/src/Filters/SideBar/_EventSidebarFilter.py +++ b/src/Filters/SideBar/_EventSidebarFilter.py @@ -135,8 +135,8 @@ class EventSidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/SideBar/_FamilySidebarFilter.py b/src/Filters/SideBar/_FamilySidebarFilter.py index ca7bfbf32..81a71b115 100644 --- a/src/Filters/SideBar/_FamilySidebarFilter.py +++ b/src/Filters/SideBar/_FamilySidebarFilter.py @@ -189,8 +189,8 @@ class FamilySidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/SideBar/_MediaSidebarFilter.py b/src/Filters/SideBar/_MediaSidebarFilter.py index 12bc0db45..d61e35b60 100644 --- a/src/Filters/SideBar/_MediaSidebarFilter.py +++ b/src/Filters/SideBar/_MediaSidebarFilter.py @@ -128,8 +128,8 @@ class MediaSidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/SideBar/_PersonSidebarFilter.py b/src/Filters/SideBar/_PersonSidebarFilter.py index b9d4c6b75..1671ab4cd 100644 --- a/src/Filters/SideBar/_PersonSidebarFilter.py +++ b/src/Filters/SideBar/_PersonSidebarFilter.py @@ -176,8 +176,8 @@ class PersonSidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/SideBar/_PlaceSidebarFilter.py b/src/Filters/SideBar/_PlaceSidebarFilter.py index 17b780170..95955e069 100644 --- a/src/Filters/SideBar/_PlaceSidebarFilter.py +++ b/src/Filters/SideBar/_PlaceSidebarFilter.py @@ -140,8 +140,8 @@ class PlaceSidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/SideBar/_RepoSidebarFilter.py b/src/Filters/SideBar/_RepoSidebarFilter.py index 6d7afda20..04f341291 100644 --- a/src/Filters/SideBar/_RepoSidebarFilter.py +++ b/src/Filters/SideBar/_RepoSidebarFilter.py @@ -135,8 +135,8 @@ class RepoSidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/SideBar/_SourceSidebarFilter.py b/src/Filters/SideBar/_SourceSidebarFilter.py index 17c10685e..8d854835a 100644 --- a/src/Filters/SideBar/_SourceSidebarFilter.py +++ b/src/Filters/SideBar/_SourceSidebarFilter.py @@ -122,8 +122,8 @@ class SourceSidebarFilter(SidebarFilter): if self.generic.get_active() != 0: model = self.generic.get_model() - iter = self.generic.get_active_iter() - obj = model.get_value(iter, 0) + node = self.generic.get_active_iter() + obj = model.get_value(node, 0) rule = MatchesFilter([obj]) generic_filter.add_rule(rule) diff --git a/src/Filters/_SearchFilter.py b/src/Filters/_SearchFilter.py index f1c78ca04..510e1bb5e 100644 --- a/src/Filters/_SearchFilter.py +++ b/src/Filters/_SearchFilter.py @@ -35,9 +35,7 @@ class SearchFilter: class ExactSearchFilter(SearchFilter): def __init__(self, func, text, invert): - self.func = func - self.text = text.upper() - self.invert = invert + SearchFilter.__init__(self, func, text, invert) def match(self, handle): return self.invert ^ (self.func(handle).upper() == self.text.strip()) diff --git a/src/GrampsWidgets.py b/src/GrampsWidgets.py index 130fc4325..1e58f06b4 100644 --- a/src/GrampsWidgets.py +++ b/src/GrampsWidgets.py @@ -1201,9 +1201,7 @@ class MaskedEntry(gtk.Entry): return self._mask def get_field_text(self, field): - if not self._mask: - raise MaskError("a mask must be set before calling get_field_text") - + assert self._mask text = self.get_text() start, end = self._mask_fields[field] return text[start: end].strip() @@ -1220,8 +1218,7 @@ class MaskedEntry(gtk.Entry): @returns: fields @rtype: list of strings """ - if not self._mask: - raise MaskError("a mask must be set before calling get_fields") + assert self._mask fields = [] diff --git a/src/PageView.py b/src/PageView.py index d2a8377be..71bbec5f8 100644 --- a/src/PageView.py +++ b/src/PageView.py @@ -241,7 +241,7 @@ class BookMarkView(PageView): def enable_action_group(self, obj): PageView.enable_action_group(self, obj) - def disable_action_group(self, obj): + def disable_action_group(self): PageView.disable_action_group(self) def define_actions(self): @@ -686,7 +686,7 @@ class ListView(BookMarkView): else: self.dirty = True - def filter_toggle(self,obj): + def filter_toggle_action(self,obj): if obj.get_active(): self.search_bar.hide() self.filter_pane.show() @@ -763,7 +763,7 @@ class ListView(BookMarkView): callback=self.edit) self.add_toggle_action('Filter', None, _('_Filter'), - callback=self.filter_toggle) + callback=self.filter_toggle_action) def column_editor(self,obj): pass diff --git a/src/RelLib/_Person.py b/src/RelLib/_Person.py index 2d5f3ae0f..fa155c57b 100644 --- a/src/RelLib/_Person.py +++ b/src/RelLib/_Person.py @@ -24,13 +24,6 @@ Person object for GRAMPS """ -#------------------------------------------------------------------------- -# -# standard python modules -# -#------------------------------------------------------------------------- -from warnings import warn - #------------------------------------------------------------------------- # # GRAMPS modules @@ -47,7 +40,6 @@ from _UrlBase import UrlBase from _Name import Name from _EventRef import EventRef from _PersonRef import PersonRef -from _MarkerType import MarkerType from _AttributeType import AttributeType from _EventRoleType import EventRoleType diff --git a/src/RelLib/_PrimaryObject.py b/src/RelLib/_PrimaryObject.py index cd2e9892e..1faa25cc9 100644 --- a/src/RelLib/_PrimaryObject.py +++ b/src/RelLib/_PrimaryObject.py @@ -109,7 +109,7 @@ class PrimaryObject(BaseObject,PrivacyBase): return unicode(time.strftime('%x %X',time.localtime(self.change)), _codeset) else: - return '' + return u'' def set_handle(self,handle): """ @@ -214,3 +214,21 @@ class PrimaryObject(BaseObject,PrivacyBase): def get_marker(self): return self.marker + + def has_source_reference(self, handle): + return False + + def has_media_reference(self, handle): + return False + + def remove_source_references(self, handle_list): + pass + + def remove_media_references(self, handle_list): + pass + + def replace_source_references(self, old_handle, new_handle): + pass + + def replace_media_references(self, old_handle, new_handle): + pass diff --git a/src/Selectors/_BaseSelector.py b/src/Selectors/_BaseSelector.py index dd81b5d61..a1ca40889 100644 --- a/src/Selectors/_BaseSelector.py +++ b/src/Selectors/_BaseSelector.py @@ -25,7 +25,6 @@ # Python modules # #------------------------------------------------------------------------- -from gettext import gettext as _ try: set() except: @@ -131,19 +130,15 @@ class BaseSelector(ManagedWindow.ManagedWindow): pass def get_window_title(self): - # return _("Select something") assert False, "Must be defined in the subclass" def get_model_class(self): - # return SourceModel assert False, "Must be defined in the subclass" def get_column_titles(self): - # return [(_('Title'),350,), (_('ID'),1,50)] assert False, "Must be defined in the subclass" def get_from_handle_func(self): - # return self.db.get_source_from_handle assert False, "Must be defined in the subclass" def get_handle_column(self): diff --git a/src/Spell.py b/src/Spell.py index acdd23d76..5165689b0 100644 --- a/src/Spell.py +++ b/src/Spell.py @@ -73,5 +73,4 @@ class Spell: def __init__(self,obj): if success and Config.get(Config.SPELLCHECK): self.spell = gtkspell.Spell(obj) - lang = locale.getlocale()[0] - self.spell.set_language(lang) + self.spell.set_language(locale.getlocale()[0])