pep8 & typos

svn: r13001
This commit is contained in:
Raphael Ackermann
2009-08-14 07:07:10 +00:00
parent 64c79d5655
commit cf5ee9d657
3 changed files with 67 additions and 65 deletions

View File

@ -233,11 +233,15 @@ class NameDisplay(object):
def _sort_name_format(self, x, y): def _sort_name_format(self, x, y):
if x < 0: if x < 0:
if y<0: return x+y if y < 0:
else: return -x+y return x+y
else: else:
if y<0: return -x+y return -x+y
else: return x-y else:
if y < 0:
return -x+y
else:
return x-y
def _is_format_valid(self, num): def _is_format_valid(self, num):
try: try:
@ -256,7 +260,7 @@ class NameDisplay(object):
going to some length to optimise it as much as possible. going to some length to optimise it as much as possible.
This method constructs a new function that is specifically written This method constructs a new function that is specifically written
to format a name given a particualar format string. This is worthwhile to format a name given a particular format string. This is worthwhile
because the format string itself rarely changes, so by caching the new because the format string itself rarely changes, so by caching the new
function and calling it directly when asked to format a name to the function and calling it directly when asked to format a name to the
same format string again we can be as quick as possible. same format string again we can be as quick as possible.
@ -299,7 +303,7 @@ class NameDisplay(object):
going to some length to optimise it as much as possible. going to some length to optimise it as much as possible.
This method constructs a new function that is specifically written This method constructs a new function that is specifically written
to format a name given a particualar format string. This is worthwhile to format a name given a particular format string. This is worthwhile
because the format string itself rarely changes, so by caching the new because the format string itself rarely changes, so by caching the new
function and calling it directly when asked to format a name to the function and calling it directly when asked to format a name to the
same format string again we can be as quick as possible. same format string again we can be as quick as possible.
@ -571,7 +575,6 @@ def fn(%s):
return self.name_formats[num][_F_FN](name) return self.name_formats[num][_F_FN](name)
def display_given(self, person): def display_given(self, person):
name = person.get_primary_name()
return self.format_str(person.get_primary_name(),'%f %y') return self.format_str(person.get_primary_name(),'%f %y')
def name_grouping(self, db, person): def name_grouping(self, db, person):

View File

@ -26,7 +26,6 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gettext import gettext as _ from gettext import gettext as _
import os
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -326,8 +325,8 @@ class MessageHideDialog(object):
self.xml = Glade(toplevel='hidedialog') self.xml = Glade(toplevel='hidedialog')
self.top = self.xml.toplevel self.top = self.xml.toplevel
top.set_icon(ICON) self.top.set_icon(ICON)
top.set_title("%s - GRAMPS" % title) self.top.set_title("%s - GRAMPS" % title)
dont_show = self.xml.get_object('dont_show') dont_show = self.xml.get_object('dont_show')
dont_show.set_active(Config.get(key)) dont_show.set_active(Config.get(key))
@ -339,8 +338,8 @@ class MessageHideDialog(object):
self.xml.get_object('message').set_text(message) self.xml.get_object('message').set_text(message)
dont_show.connect('toggled', self.update_checkbox, key) dont_show.connect('toggled', self.update_checkbox, key)
top.run() self.top.run()
top.destroy() self.top.destroy()
def update_checkbox(self, obj, constant): def update_checkbox(self, obj, constant):
Config.set(constant, obj.get_active()) Config.set(constant, obj.get_active())

View File

@ -21,7 +21,7 @@
# $Id$ # $Id$
""" """
Researcher informaiton for GRAMPS. Researcher information for GRAMPS.
""" """
#------------------------------------------------------------------------- #-------------------------------------------------------------------------