fixing else clauses on loops
This commit is contained in:
@@ -55,5 +55,4 @@ class RegExpName(Rule):
|
|||||||
name.title, name.nick, name.famnick, name.call]:
|
name.title, name.nick, name.famnick, name.call]:
|
||||||
if self.match_substring(0, field):
|
if self.match_substring(0, field):
|
||||||
return True
|
return True
|
||||||
else:
|
return False
|
||||||
return False
|
|
||||||
|
@@ -57,5 +57,4 @@ class SearchName(Rule):
|
|||||||
name.title, name.nick, name.famnick, name.call]:
|
name.title, name.nick, name.famnick, name.call]:
|
||||||
if src and field.upper().find(src) != -1:
|
if src and field.upper().find(src) != -1:
|
||||||
return True
|
return True
|
||||||
else:
|
return False
|
||||||
return False
|
|
||||||
|
@@ -692,8 +692,7 @@ class Person(CitationBase, NoteBase, AttributeBase, MediaBase,
|
|||||||
for attr in self.attribute_list:
|
for attr in self.attribute_list:
|
||||||
if int(attr.type) == AttributeType.NICKNAME:
|
if int(attr.type) == AttributeType.NICKNAME:
|
||||||
return attr.get_value()
|
return attr.get_value()
|
||||||
else:
|
return ''
|
||||||
return ''
|
|
||||||
|
|
||||||
def set_gender(self, gender) :
|
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):
|
for self.birth_ref_index, ref in enumerate(self.event_ref_list):
|
||||||
if event_ref.is_equal(ref):
|
if event_ref.is_equal(ref):
|
||||||
return # Note: self.birth_ref_index already set
|
return # Note: self.birth_ref_index already set
|
||||||
else:
|
|
||||||
self.event_ref_list.append(event_ref)
|
self.event_ref_list.append(event_ref)
|
||||||
self.birth_ref_index = len(self.event_ref_list)-1
|
self.birth_ref_index = len(self.event_ref_list)-1
|
||||||
|
|
||||||
def set_death_ref(self, event_ref):
|
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):
|
for self.death_ref_index, ref in enumerate(self.event_ref_list):
|
||||||
if event_ref.is_equal(ref):
|
if event_ref.is_equal(ref):
|
||||||
return # Note: self.death_ref_index already set
|
return # Note: self.death_ref_index already set
|
||||||
else:
|
|
||||||
self.event_ref_list.append(event_ref)
|
self.event_ref_list.append(event_ref)
|
||||||
self.death_ref_index = len(self.event_ref_list)-1
|
self.death_ref_index = len(self.event_ref_list)-1
|
||||||
|
|
||||||
def get_birth_ref(self):
|
def get_birth_ref(self):
|
||||||
"""
|
"""
|
||||||
|
@@ -214,5 +214,5 @@ class Glade(Gtk.Builder):
|
|||||||
return obj
|
return obj
|
||||||
if hasattr(obj, 'get_children'):
|
if hasattr(obj, 'get_children'):
|
||||||
queue += obj.get_children()
|
queue += obj.get_children()
|
||||||
else:
|
|
||||||
return None
|
return None
|
||||||
|
@@ -549,8 +549,7 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
|
|||||||
button = self.format_buttons[ix]
|
button = self.format_buttons[ix]
|
||||||
if button.get_active():
|
if button.get_active():
|
||||||
return ix
|
return ix
|
||||||
else:
|
return 0
|
||||||
return 0
|
|
||||||
|
|
||||||
def suggest_filename(self):
|
def suggest_filename(self):
|
||||||
"""Prepare suggested filename and set it in the file chooser."""
|
"""Prepare suggested filename and set it in the file chooser."""
|
||||||
|
@@ -275,8 +275,8 @@ class SelectionPage(Gtk.Box):
|
|||||||
button = self.batch_op_buttons[index]
|
button = self.batch_op_buttons[index]
|
||||||
if button.get_active():
|
if button.get_active():
|
||||||
return index
|
return index
|
||||||
else:
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
class SettingsPage(Gtk.Box):
|
class SettingsPage(Gtk.Box):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user