2007-01-03 Don Allingham <don@gramps-project.org>

* 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



svn: r7866
This commit is contained in:
Don Allingham 2007-01-04 05:09:41 +00:00
parent 485edbc74a
commit 27c5699825
17 changed files with 61 additions and 51 deletions

View File

@ -1,3 +1,21 @@
2007-01-03 Don Allingham <don@gramps-project.org>
* 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 <don@gramps-project.org> 2007-01-02 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_WriteGedcom.py: handle illegal confidence * src/GrampsDb/_WriteGedcom.py: handle illegal confidence
* src/RelLib/_Person.py: set_parent_family_list * src/RelLib/_Person.py: set_parent_family_list

View File

@ -19,13 +19,6 @@
# $Id$ # $Id$
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# gramps modules # gramps modules

View File

@ -60,7 +60,7 @@ import Config
import const import const
from Editors import EditPerson from Editors import EditPerson
from Filters import SearchBar, SearchFilter from Filters import SearchBar, SearchFilter, ExactSearchFilter
from Filters.SideBar import PersonSidebarFilter from Filters.SideBar import PersonSidebarFilter
from DdTargets import DdTargets from DdTargets import DdTargets
@ -155,8 +155,8 @@ class PersonView(PageView.PersonNavView):
self.edit_action.set_visible(False) self.edit_action.set_visible(False)
self.edit_action.set_sensitive(not self.dbstate.db.readonly) self.edit_action.set_sensitive(not self.dbstate.db.readonly)
def disable_action_group(self, obj): def disable_action_group(self):
PageView.PersonNavView.disable_action_group(self, obj) PageView.PersonNavView.disable_action_group(self)
self.all_action.set_visible(False) self.all_action.set_visible(False)
self.edit_action.set_visible(False) self.edit_action.set_visible(False)

View File

@ -135,8 +135,8 @@ class EventSidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -189,8 +189,8 @@ class FamilySidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -128,8 +128,8 @@ class MediaSidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -176,8 +176,8 @@ class PersonSidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -140,8 +140,8 @@ class PlaceSidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -135,8 +135,8 @@ class RepoSidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -122,8 +122,8 @@ class SourceSidebarFilter(SidebarFilter):
if self.generic.get_active() != 0: if self.generic.get_active() != 0:
model = self.generic.get_model() model = self.generic.get_model()
iter = self.generic.get_active_iter() node = self.generic.get_active_iter()
obj = model.get_value(iter, 0) obj = model.get_value(node, 0)
rule = MatchesFilter([obj]) rule = MatchesFilter([obj])
generic_filter.add_rule(rule) generic_filter.add_rule(rule)

View File

@ -35,9 +35,7 @@ class SearchFilter:
class ExactSearchFilter(SearchFilter): class ExactSearchFilter(SearchFilter):
def __init__(self, func, text, invert): def __init__(self, func, text, invert):
self.func = func SearchFilter.__init__(self, func, text, invert)
self.text = text.upper()
self.invert = invert
def match(self, handle): def match(self, handle):
return self.invert ^ (self.func(handle).upper() == self.text.strip()) return self.invert ^ (self.func(handle).upper() == self.text.strip())

View File

@ -1201,9 +1201,7 @@ class MaskedEntry(gtk.Entry):
return self._mask return self._mask
def get_field_text(self, field): def get_field_text(self, field):
if not self._mask: assert self._mask
raise MaskError("a mask must be set before calling get_field_text")
text = self.get_text() text = self.get_text()
start, end = self._mask_fields[field] start, end = self._mask_fields[field]
return text[start: end].strip() return text[start: end].strip()
@ -1220,8 +1218,7 @@ class MaskedEntry(gtk.Entry):
@returns: fields @returns: fields
@rtype: list of strings @rtype: list of strings
""" """
if not self._mask: assert self._mask
raise MaskError("a mask must be set before calling get_fields")
fields = [] fields = []

View File

@ -241,7 +241,7 @@ class BookMarkView(PageView):
def enable_action_group(self, obj): def enable_action_group(self, obj):
PageView.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) PageView.disable_action_group(self)
def define_actions(self): def define_actions(self):
@ -686,7 +686,7 @@ class ListView(BookMarkView):
else: else:
self.dirty = True self.dirty = True
def filter_toggle(self,obj): def filter_toggle_action(self,obj):
if obj.get_active(): if obj.get_active():
self.search_bar.hide() self.search_bar.hide()
self.filter_pane.show() self.filter_pane.show()
@ -763,7 +763,7 @@ class ListView(BookMarkView):
callback=self.edit) callback=self.edit)
self.add_toggle_action('Filter', None, _('_Filter'), self.add_toggle_action('Filter', None, _('_Filter'),
callback=self.filter_toggle) callback=self.filter_toggle_action)
def column_editor(self,obj): def column_editor(self,obj):
pass pass

View File

@ -24,13 +24,6 @@
Person object for GRAMPS Person object for GRAMPS
""" """
#-------------------------------------------------------------------------
#
# standard python modules
#
#-------------------------------------------------------------------------
from warnings import warn
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# GRAMPS modules # GRAMPS modules
@ -47,7 +40,6 @@ from _UrlBase import UrlBase
from _Name import Name from _Name import Name
from _EventRef import EventRef from _EventRef import EventRef
from _PersonRef import PersonRef from _PersonRef import PersonRef
from _MarkerType import MarkerType
from _AttributeType import AttributeType from _AttributeType import AttributeType
from _EventRoleType import EventRoleType from _EventRoleType import EventRoleType

View File

@ -109,7 +109,7 @@ class PrimaryObject(BaseObject,PrivacyBase):
return unicode(time.strftime('%x %X',time.localtime(self.change)), return unicode(time.strftime('%x %X',time.localtime(self.change)),
_codeset) _codeset)
else: else:
return '' return u''
def set_handle(self,handle): def set_handle(self,handle):
""" """
@ -214,3 +214,21 @@ class PrimaryObject(BaseObject,PrivacyBase):
def get_marker(self): def get_marker(self):
return self.marker 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

View File

@ -25,7 +25,6 @@
# Python modules # Python modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gettext import gettext as _
try: try:
set() set()
except: except:
@ -131,19 +130,15 @@ class BaseSelector(ManagedWindow.ManagedWindow):
pass pass
def get_window_title(self): def get_window_title(self):
# return _("Select something")
assert False, "Must be defined in the subclass" assert False, "Must be defined in the subclass"
def get_model_class(self): def get_model_class(self):
# return SourceModel
assert False, "Must be defined in the subclass" assert False, "Must be defined in the subclass"
def get_column_titles(self): def get_column_titles(self):
# return [(_('Title'),350,), (_('ID'),1,50)]
assert False, "Must be defined in the subclass" assert False, "Must be defined in the subclass"
def get_from_handle_func(self): def get_from_handle_func(self):
# return self.db.get_source_from_handle
assert False, "Must be defined in the subclass" assert False, "Must be defined in the subclass"
def get_handle_column(self): def get_handle_column(self):

View File

@ -73,5 +73,4 @@ class Spell:
def __init__(self,obj): def __init__(self,obj):
if success and Config.get(Config.SPELLCHECK): if success and Config.get(Config.SPELLCHECK):
self.spell = gtkspell.Spell(obj) self.spell = gtkspell.Spell(obj)
lang = locale.getlocale()[0] self.spell.set_language(locale.getlocale()[0])
self.spell.set_language(lang)