fixing else clauses on loops

This commit is contained in:
Tom Samstag
2015-12-30 22:46:57 -08:00
parent 4053d84a5f
commit de8d8370e3
6 changed files with 14 additions and 18 deletions

View File

@@ -55,5 +55,4 @@ class RegExpName(Rule):
name.title, name.nick, name.famnick, name.call]:
if self.match_substring(0, field):
return True
else:
return False
return False

View File

@@ -57,5 +57,4 @@ class SearchName(Rule):
name.title, name.nick, name.famnick, name.call]:
if src and field.upper().find(src) != -1:
return True
else:
return False
return False

View File

@@ -692,8 +692,7 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
for attr in self.attribute_list:
if int(attr.type) == AttributeType.NICKNAME:
return attr.get_value()
else:
return ''
return ''
def set_gender(self, gender) :
"""
@@ -743,9 +742,9 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
for self.birth_ref_index, ref in enumerate(self.event_ref_list):
if event_ref.is_equal(ref):
return # Note: self.birth_ref_index already set
else:
self.event_ref_list.append(event_ref)
self.birth_ref_index = len(self.event_ref_list)-1
self.event_ref_list.append(event_ref)
self.birth_ref_index = len(self.event_ref_list)-1
def set_death_ref(self, event_ref):
"""
@@ -768,9 +767,9 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
for self.death_ref_index, ref in enumerate(self.event_ref_list):
if event_ref.is_equal(ref):
return # Note: self.death_ref_index already set
else:
self.event_ref_list.append(event_ref)
self.death_ref_index = len(self.event_ref_list)-1
self.event_ref_list.append(event_ref)
self.death_ref_index = len(self.event_ref_list)-1
def get_birth_ref(self):
"""

View File

@@ -214,5 +214,5 @@ class Glade(Gtk.Builder):
return obj
if hasattr(obj, 'get_children'):
queue += obj.get_children()
else:
return None
return None

View File

@@ -549,8 +549,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
button = self.format_buttons[ix]
if button.get_active():
return ix
else:
return 0
return 0
def suggest_filename(self):
"""Prepare suggested filename and set it in the file chooser."""

View File

@@ -275,8 +275,8 @@ class SelectionPage(Gtk.Box):
button = self.batch_op_buttons[index]
if button.get_active():
return index
else:
return 0
return 0
class SettingsPage(Gtk.Box):
"""