Small code improvements.

This commit is contained in:
Baizley 2020-02-01 00:18:59 +01:00 committed by Nick Hall
parent 7248f073f0
commit a9a1b7b57e
5 changed files with 8 additions and 16 deletions

View File

@ -343,8 +343,8 @@ class ArgParser:
print(_("Gramps config settings from %s:"
) % config.filename)
for sect, settings in config.data.items():
for setting, value in settings.items():
print("%s.%s=%s" % (sect, setting, repr(value)))
for settings_index, setting in settings.items():
print("%s.%s=%s" % (sect, settings_index, repr(value)))
print()
sys.exit(0)
elif option in ['-c', '--config']:
@ -434,7 +434,8 @@ class ArgParser:
sys.exit(0) # Done with Default
#clean options list
for ind in reversed(cleandbg):
cleandbg.reverse()
for ind in cleandbg:
del options[ind]
if (len(options) > 0

View File

@ -154,7 +154,7 @@ class RecentFiles:
for recent_file in self.gramps_recent_files:
if recent_file.get_name() == filename:
recent_file.set_name(new_filename)
break
return
def remove_filename(self, filename):
"""
@ -163,7 +163,7 @@ class RecentFiles:
for index, recent_file in enumerate(self.gramps_recent_files):
if recent_file.get_name() == filename:
self.gramps_recent_files.pop(index)
break
return
def check_if_recent(self, filename):
"""

View File

@ -148,14 +148,6 @@ class SurnameTab(EmbeddedList):
self.columns.append(column)
self.tree.append_column(column)
## def by_value(self, first, second):
## """
## Method for sorting keys based on the values.
## """
## fvalue = self.cmborigmap[first]
## svalue = self.cmborigmap[second]
## return glocale.strcoll(fvalue, svalue)
def setup_editable_col(self):
"""
inherit this and set the variables needed for editable columns

View File

@ -41,7 +41,6 @@ import pickle
#-------------------------------------------------------------------------
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from gi.repository.GLib import markup_escape_text
#-------------------------------------------------------------------------

View File

@ -1050,8 +1050,8 @@ class StatisticsChartOptions(MenuReportOptions):
gender = EnumeratedListOption(_('Genders included'),
Person.UNKNOWN)
for item in enumerate(_options.opt_genders):
gender.add_item(item[0], item[2])
for first, second, third in _options.opt_genders:
gender.add_item(first, third)
gender.set_help(_("Select which genders are included into "
"statistics."))
add_option("gender", gender)