updated cli option names to be more uniform
removed '2' from class names


svn: r16998
This commit is contained in:
Craig J. Anderson 2011-03-30 23:19:10 +00:00
parent ff092766b1
commit 3db14905db
3 changed files with 74 additions and 74 deletions

View File

@ -185,21 +185,21 @@ class CalcItems(object):
self.__blank_father = None
self.__blank_mother = None
main = self.__calc_l.calc_lines( None, None, __gui.get_val('dispf'))
secn = self.__calc_l.calc_lines( None, None, __gui.get_val('disp_sec'))
main = self.__calc_l.calc_lines( None, None, __gui.get_val("main_disp"))
secn = self.__calc_l.calc_lines( None, None, __gui.get_val("sec_disp"))
self.disp_father = __gui.get_val('dispf')
self.disp_father = __gui.get_val("main_disp")
self.__blank_father = main
self.disp_mother = __gui.get_val('dispf')
self.disp_mother = __gui.get_val("main_disp")
self.__blank_mother = main
if __gui.get_val('dif_sec') == 1:
self.disp_father = __gui.get_val('disp_sec')
self.disp_father = __gui.get_val("sec_disp")
self.__blank_father = secn
elif __gui.get_val('dif_sec') == 2:
self.disp_mother = __gui.get_val('disp_sec')
self.disp_mother = __gui.get_val("sec_disp")
self.__blank_mother = secn
self.disp_marr = [__gui.get_val('dispmarr')]
self.disp_marr = [__gui.get_val("marr_disp")]
self.__blank_marriage = \
self.__calc_l.calc_lines(None, None, self.disp_marr)
@ -661,7 +661,7 @@ class GUIConnect():
# AncestorTree
#
#------------------------------------------------------------------------
class AncestorTree2(Report):
class AncestorTree(Report):
def __init__(self, database, options_class):
"""
@ -715,7 +715,7 @@ class AncestorTree2(Report):
self.progress.set_pass(_('Making the Tree...'), 4)
#make the tree onto the canvas
inlc_marr = self.connect.get_val('incmarr')
inlc_marr = self.connect.get_val("inc_marr")
self.max_generations = self.connect.get_val('maxgen')
fillout = self.connect.get_val('fillout')
tree = MakeAncestorTree(database, self.canvas, self.max_generations,
@ -744,9 +744,9 @@ class AncestorTree2(Report):
self.progress.step()
#Note?
if self.connect.get_val('use_note'):
if self.connect.get_val("inc_note"):
note_box = NoteBox(self.doc, "AC2-fam-box",
self.connect.get_val('note_local'))
self.connect.get_val("note_place"))
subst = SubstKeywords(self.database, None, None)
note_box.text = subst.replace_and_clean(
self.connect.get_val('note_disp'))
@ -754,8 +754,8 @@ class AncestorTree2(Report):
#Now we have the report in its full size.
#Do we want to scale the report?
one_page = self.connect.get_val('onepage')
scale_report = self.connect.get_val('scale_report')
one_page = self.connect.get_val("resize_page")
scale_report = self.connect.get_val("scale_tree")
scale = self.canvas.scale_report(one_page,
scale_report != 0, scale_report == 2)
@ -764,13 +764,13 @@ class AncestorTree2(Report):
def write_report(self):
one_page = self.connect.get_val('onepage')
#scale_report = self.connect.get_val('scale_report')
one_page = self.connect.get_val("resize_page")
#scale_report = self.connect.get_val("scale_tree")
#inlc_marr = self.connect.get_val('incmarr')
#inlc_marr = self.connect.get_val("inc_marr")
inc_border = self.connect.get_val('inc_border')
incblank = self.connect.get_val('incblank')
prnnum = self.connect.get_val('prnnum')
incblank = self.connect.get_val("inc_blank")
prnnum = self.connect.get_val("inc_pagenum")
#####################
#Setup page infomation
@ -864,7 +864,7 @@ class AncestorTree2(Report):
# AncestorTreeOptions
#
#------------------------------------------------------------------------
class AncestorTree2Options(MenuReportOptions):
class AncestorTreeOptions(MenuReportOptions):
"""
Defines options and provides handling interface.
@ -912,7 +912,7 @@ class AncestorTree2Options(MenuReportOptions):
disp = TextOption(_("Main\nDisplay Format"),
["$n","%s $b" % _BORN,"%s $d" %_DIED] )
disp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "dispf", disp)
menu.add_option(category_name, "main_disp", disp)
difMom = EnumeratedListOption(_("Use Main/Secondary\nDisplay "
"Format for"), 0)
@ -941,16 +941,16 @@ class AncestorTree2Options(MenuReportOptions):
"%s $d" %_DIED]
)
dispMom.set_help(_("Display format for the output box."))
menu.add_option(category_name, "disp_sec", dispMom)
menu.add_option(category_name, "sec_disp", dispMom)
incmarr = BooleanOption(_('Include Marriage information'), False)
incmarr.set_help(_("Whether to include marriage information in the "
"report."))
menu.add_option(category_name, "incmarr", incmarr)
menu.add_option(category_name, "inc_marr", incmarr)
marrdisp = StringOption(_("Marriage\nDisplay Format"), "%s $m" % _MARR)
marrdisp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "dispmarr", marrdisp)
menu.add_option(category_name, "marr_disp", marrdisp)
category_name = _("Print")
@ -961,7 +961,7 @@ class AncestorTree2Options(MenuReportOptions):
self.scale.set_help(
_("Whether to scale the tree to fit a specific paper size")
)
menu.add_option(category_name, "scale_report", self.scale)
menu.add_option(category_name, "scale_tree", self.scale)
self.scale.connect('value-changed', self.__check_blank)
if "BKI" not in self.name.split(","):
@ -986,7 +986,7 @@ class AncestorTree2Options(MenuReportOptions):
" either the height or width.")
)
menu.add_option(category_name, "onepage", self.__onepage)
menu.add_option(category_name, "resize_page", self.__onepage)
self.__onepage.connect('value-changed', self.__check_blank)
else:
self.__onepage = None
@ -1002,11 +1002,11 @@ class AncestorTree2Options(MenuReportOptions):
prnnum = BooleanOption(_('Print Page Numbers'), False)
prnnum.set_help(_("Whether to print page numbers on each page."))
menu.add_option(category_name, "prnnum", prnnum)
menu.add_option(category_name, "inc_pagenum", prnnum)
self.__blank = BooleanOption(_('Include Blank Pages'), True)
self.__blank.set_help(_("Whether to include pages that are blank."))
menu.add_option(category_name, "incblank", self.__blank)
menu.add_option(category_name, "inc_blank", self.__blank)
self.__check_blank()
@ -1015,7 +1015,7 @@ class AncestorTree2Options(MenuReportOptions):
self.usenote = BooleanOption(_('Include a personal note'), False)
self.usenote.set_help(_("Whether to include a personalized note on "
"the report."))
menu.add_option(category_name, "use_note", self.usenote)
menu.add_option(category_name, "inc_note", self.usenote)
self.notedisp = TextOption(_("Note to add\nto the graph\n\n$T "
"inserts today's date"), [])
@ -1027,7 +1027,7 @@ class AncestorTree2Options(MenuReportOptions):
for num, text in locales.note_locals():
notelocal.add_item( num, text )
notelocal.set_help(_("Where to place a personal note."))
menu.add_option(category_name, "note_local", notelocal)
menu.add_option(category_name, "note_place", notelocal)
def __check_blank(self):
if self.__onepage:

View File

@ -389,7 +389,7 @@ class RecurseDown:
self.do_gparents = gui.get_val('show_gparents')
self.max_generations = gui.get_val('maxgen')
self.max_spouses = gui.get_val('maxspouse')
self.inlc_marr = gui.get_val('incmarr')
self.inlc_marr = gui.get_val("inc_marr")
if not self.max_spouses:
self.inlc_marr = False
@ -951,7 +951,7 @@ class MakeReport(object):
gui = GuiConnect()
self.do_gparents = gui.get_val('show_gparents')
self.inlc_marr = gui.get_val('incmarr')
self.inlc_marr = gui.get_val("inc_marr")
self.max_spouses = gui.get_val('maxspouse')
gui = None
@ -1235,19 +1235,19 @@ class GuiConnect():
def calc_lines(self, database):
#calculate the printed lines for each box
display_repl = self.get_val('replacelist')
display_repl = self.get_val("replace_list")
#str = ""
#if self.get_val('miss_val'):
# str = "_____"
return CalcLines(database, display_repl)
def working_lines(self, box):
display = self.get_val('dispf')
display = self.get_val("main_disp")
if self.get_val('diffspouse'):
display_spou = self.get_val('sdispf')
display_spou = self.get_val("spouse_disp")
else:
display_spou = display
display_marr = [self.get_val('dispmarr')]
display_marr = [self.get_val("marr_disp")]
if box.boxstr == "CG2-fam-box": #(((((
workinglines = display_marr
@ -1263,11 +1263,11 @@ class GuiConnect():
# DescendTree
#
#------------------------------------------------------------------------
class Descend2Tree(Report):
class DescendTree(Report):
def __init__(self, database, options_class):
"""
Create Descend2Tree object that produces the report.
Create DescendTree object that produces the report.
The arguments are:
database - the GRAMPS database instance
@ -1308,16 +1308,16 @@ class Descend2Tree(Report):
self.canvas.add_title(title)
#make the report as big as it wants to be.
ind_spouse = self.Connect.get_val('indspouce')
ind_spouse = self.Connect.get_val("ind_spouse")
compress_tree = self.Connect.get_val('compress_tree')
report = MakeReport(database, self.canvas, ind_spouse, compress_tree)
report.start()
report = None
#note?
if self.Connect.get_val('use_note'):
if self.Connect.get_val("inc_note"):
note_box = NoteBox(self.doc, "CG2-fam-box",
self.Connect.get_val('note_local'))
self.Connect.get_val("note_place"))
subst = SubstKeywords(self.database, None, None)
note_box.text = subst.replace_and_clean(
self.Connect.get_val('note_disp'))
@ -1325,8 +1325,8 @@ class Descend2Tree(Report):
#Now we have the report in its full size.
#Do we want to scale the report?
one_page = self.Connect.get_val('onepage')
scale_report = self.Connect.get_val('scale_report')
one_page = self.Connect.get_val("resize_page")
scale_report = self.Connect.get_val("scale_tree")
scale = self.canvas.scale_report(one_page,
scale_report != 0, scale_report == 2)
@ -1338,14 +1338,14 @@ class Descend2Tree(Report):
""" Canvas now has everyone ready to print. Get some misc stuff
together and print. """
one_page = self.Connect.get_val('onepage')
scale_report = self.Connect.get_val('scale_report')
one_page = self.Connect.get_val("resize_page")
scale_report = self.Connect.get_val("scale_tree")
#Inlc_marr = self.Connect.get_val('incmarr')
#Inlc_marr = self.Connect.get_val("inc_marr")
inc_border = self.Connect.get_val('inc_border')
incblank = self.Connect.get_val('incblank')
prnnum = self.Connect.get_val('prnnum')
#ind_spouse = self.Connect.get_val('indspouce')
incblank = self.Connect.get_val("inc_blank")
prnnum = self.Connect.get_val("inc_pagenum")
#ind_spouse = self.Connect.get_val("ind_spouse")
lines = self.Connect.get_val('note_disp')
#####################
@ -1441,7 +1441,7 @@ class Descend2Tree(Report):
# DescendTreeOptions
#
#------------------------------------------------------------------------
class Descend2TreeOptions(MenuReportOptions):
class DescendTreeOptions(MenuReportOptions):
"""
Defines options and provides handling interface.
@ -1482,7 +1482,7 @@ class Descend2TreeOptions(MenuReportOptions):
)
menu.add_option(category_name, "show_gparents", self.showparents)
max_gen = NumberOption(_("Generations"), 2, 1, 50)
max_gen = NumberOption(_("Generations"), 10, 1, 50)
max_gen.set_help(_("The number of generations to include in the tree"))
menu.add_option(category_name, "maxgen", max_gen)
@ -1500,7 +1500,7 @@ class Descend2TreeOptions(MenuReportOptions):
disp = TextOption(_("Personal\nDisplay Format"),
["$n","%s $b" % _BORN,"%s $d" %_DIED])
disp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "dispf", disp)
menu.add_option(category_name, "main_disp", disp)
bold = BooleanOption(_('Bold direct descendants'), True)
bold.set_help(
@ -1527,22 +1527,22 @@ class Descend2TreeOptions(MenuReportOptions):
indspouce = BooleanOption(_('Indent Spouses'), True)
indspouce.set_help(_("Whether to indent the spouses in the tree."))
menu.add_option(category_name, "indspouce", indspouce)
menu.add_option(category_name, "ind_spouse", indspouce)
sdisp = TextOption(_("Spousal\nDisplay Format"),
["$n","%s $b" % _BORN,"%s $d" %_DIED])
sdisp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "sdispf", sdisp)
menu.add_option(category_name, "spouse_disp", sdisp)
incmarr = BooleanOption(_('Include Marriage information'), True)
incmarr.set_help(
_("Whether to include marriage information in the report.")
)
menu.add_option(category_name, "incmarr", incmarr)
menu.add_option(category_name, "inc_marr", incmarr)
marrdisp = StringOption(_("Marriage\nDisplay Format"), "%s $m" % _MARR)
marrdisp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "dispmarr", marrdisp)
menu.add_option(category_name, "marr_disp", marrdisp)
category_name = _("Replace")
@ -1550,7 +1550,7 @@ class Descend2TreeOptions(MenuReportOptions):
_("Replace Display Format:\n'Replace this'/' with this'"),
[])
repldisp.set_help(_("i.e.\nUnited States of America/U.S.A"))
menu.add_option(category_name, "replacelist", repldisp)
menu.add_option(category_name, "replace_list", repldisp)
category_name = _("Print")
@ -1561,7 +1561,7 @@ class Descend2TreeOptions(MenuReportOptions):
self.scale.set_help(
_("Whether to scale the tree to fit a specific paper size")
)
menu.add_option(category_name, "scale_report", self.scale)
menu.add_option(category_name, "scale_tree", self.scale)
self.scale.connect('value-changed', self.__check_blank)
if "BKI" not in self.name.split(","):
@ -1586,7 +1586,7 @@ class Descend2TreeOptions(MenuReportOptions):
" either the height or width.")
)
menu.add_option(category_name, "onepage", self.__onepage)
menu.add_option(category_name, "resize_page", self.__onepage)
self.__onepage.connect('value-changed', self.__check_blank)
else:
self.__onepage = None
@ -1604,11 +1604,11 @@ class Descend2TreeOptions(MenuReportOptions):
prnnum = BooleanOption(_('Print Page Numbers'), False)
prnnum.set_help(_("Whether to print page numbers on each page."))
menu.add_option(category_name, "prnnum", prnnum)
menu.add_option(category_name, "inc_pagenum", prnnum)
self.__blank = BooleanOption(_('Include Blank Pages'), True)
self.__blank.set_help(_("Whether to include pages that are blank."))
menu.add_option(category_name, "incblank", self.__blank)
menu.add_option(category_name, "inc_blank", self.__blank)
category_name = _("Notes")
@ -1616,7 +1616,7 @@ class Descend2TreeOptions(MenuReportOptions):
self.usenote.set_help(
_("Whether to include a personalized note on the report.")
)
menu.add_option(category_name, "use_note", self.usenote)
menu.add_option(category_name, "inc_note", self.usenote)
self.notedisp = TextOption(
_("Note to add\nto the graph\n\n$T inserts today's date"),
@ -1629,7 +1629,7 @@ class Descend2TreeOptions(MenuReportOptions):
for num, text in locals.note_locals():
notelocal.add_item( num, text )
notelocal.set_help(_("Where to place a personal note."))
menu.add_option(category_name, "note_local", notelocal)
menu.add_option(category_name, "note_place", notelocal)
def __check_blank(self):
"""dis/enables the 'print blank pages' checkbox"""

View File

@ -39,8 +39,8 @@ plg.ptype = REPORT
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'AncestorTree2'
plg.optionclass = 'AncestorTree2Options'
plg.reportclass = 'AncestorTree'
plg.optionclass = 'AncestorTreeOptions'
plg.report_modes = [REPORT_MODE_BKI]
plg = newplugin()
@ -55,8 +55,8 @@ plg.ptype = REPORT
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'AncestorTree2'
plg.optionclass = 'AncestorTree2Options'
plg.reportclass = 'AncestorTree'
plg.optionclass = 'AncestorTreeOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_CLI]
#------------------------------------------------------------------------
@ -99,8 +99,8 @@ plg.ptype = REPORT
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'Descend2Tree'
plg.optionclass = 'Descend2TreeOptions'
plg.reportclass = 'DescendTree'
plg.optionclass = 'DescendTreeOptions'
plg.report_modes = [REPORT_MODE_BKI]
plg = newplugin()
@ -115,8 +115,8 @@ plg.ptype = REPORT
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'Descend2Tree'
plg.optionclass = 'Descend2TreeOptions'
plg.reportclass = 'DescendTree'
plg.optionclass = 'DescendTreeOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_CLI]
#------------------------------------------------------------------------
@ -138,8 +138,8 @@ plg.gramps_target_version = '3.3'
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@gramps-project.org"]
plg.require_active = True
plg.reportclass = 'Descend2Tree'
plg.optionclass = 'Descend2TreeOptions'
plg.reportclass = 'DescendTree'
plg.optionclass = 'DescendTreeOptions'
plg.report_modes = [REPORT_MODE_BKI]
plg = newplugin()
@ -155,8 +155,8 @@ plg.gramps_target_version = '3.3'
plg.authors = ["Craig J. Anderson"]
plg.authors_email = ["ander882@gramps-project.org"]
plg.require_active = True
plg.reportclass = 'Descend2Tree'
plg.optionclass = 'Descend2TreeOptions'
plg.reportclass = 'DescendTree'
plg.optionclass = 'DescendTreeOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_CLI]
#------------------------------------------------------------------------