Small code improvements.
This commit is contained in:
parent
7248f073f0
commit
a9a1b7b57e
@ -343,8 +343,8 @@ class ArgParser:
|
|||||||
print(_("Gramps config settings from %s:"
|
print(_("Gramps config settings from %s:"
|
||||||
) % config.filename)
|
) % config.filename)
|
||||||
for sect, settings in config.data.items():
|
for sect, settings in config.data.items():
|
||||||
for setting, value in settings.items():
|
for settings_index, setting in settings.items():
|
||||||
print("%s.%s=%s" % (sect, setting, repr(value)))
|
print("%s.%s=%s" % (sect, settings_index, repr(value)))
|
||||||
print()
|
print()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif option in ['-c', '--config']:
|
elif option in ['-c', '--config']:
|
||||||
@ -434,7 +434,8 @@ class ArgParser:
|
|||||||
sys.exit(0) # Done with Default
|
sys.exit(0) # Done with Default
|
||||||
|
|
||||||
#clean options list
|
#clean options list
|
||||||
for ind in reversed(cleandbg):
|
cleandbg.reverse()
|
||||||
|
for ind in cleandbg:
|
||||||
del options[ind]
|
del options[ind]
|
||||||
|
|
||||||
if (len(options) > 0
|
if (len(options) > 0
|
||||||
|
@ -154,7 +154,7 @@ class RecentFiles:
|
|||||||
for recent_file in self.gramps_recent_files:
|
for recent_file in self.gramps_recent_files:
|
||||||
if recent_file.get_name() == filename:
|
if recent_file.get_name() == filename:
|
||||||
recent_file.set_name(new_filename)
|
recent_file.set_name(new_filename)
|
||||||
break
|
return
|
||||||
|
|
||||||
def remove_filename(self, filename):
|
def remove_filename(self, filename):
|
||||||
"""
|
"""
|
||||||
@ -163,7 +163,7 @@ class RecentFiles:
|
|||||||
for index, recent_file in enumerate(self.gramps_recent_files):
|
for index, recent_file in enumerate(self.gramps_recent_files):
|
||||||
if recent_file.get_name() == filename:
|
if recent_file.get_name() == filename:
|
||||||
self.gramps_recent_files.pop(index)
|
self.gramps_recent_files.pop(index)
|
||||||
break
|
return
|
||||||
|
|
||||||
def check_if_recent(self, filename):
|
def check_if_recent(self, filename):
|
||||||
"""
|
"""
|
||||||
|
@ -148,14 +148,6 @@ class SurnameTab(EmbeddedList):
|
|||||||
self.columns.append(column)
|
self.columns.append(column)
|
||||||
self.tree.append_column(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):
|
def setup_editable_col(self):
|
||||||
"""
|
"""
|
||||||
inherit this and set the variables needed for editable columns
|
inherit this and set the variables needed for editable columns
|
||||||
|
@ -41,7 +41,6 @@ import pickle
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from gi.repository import Gdk
|
from gi.repository import Gdk
|
||||||
from gi.repository import Pango
|
|
||||||
from gi.repository.GLib import markup_escape_text
|
from gi.repository.GLib import markup_escape_text
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -1050,8 +1050,8 @@ class StatisticsChartOptions(MenuReportOptions):
|
|||||||
|
|
||||||
gender = EnumeratedListOption(_('Genders included'),
|
gender = EnumeratedListOption(_('Genders included'),
|
||||||
Person.UNKNOWN)
|
Person.UNKNOWN)
|
||||||
for item in enumerate(_options.opt_genders):
|
for first, second, third in _options.opt_genders:
|
||||||
gender.add_item(item[0], item[2])
|
gender.add_item(first, third)
|
||||||
gender.set_help(_("Select which genders are included into "
|
gender.set_help(_("Select which genders are included into "
|
||||||
"statistics."))
|
"statistics."))
|
||||||
add_option("gender", gender)
|
add_option("gender", gender)
|
||||||
|
Loading…
Reference in New Issue
Block a user