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>
* src/GrampsDb/_WriteGedcom.py: handle illegal confidence
* src/RelLib/_Person.py: set_parent_family_list

View File

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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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())

View File

@ -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 = []

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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])