From b0b919d1480c5d1a7bb24293407c2ac8c79f4f03 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Fri, 19 Aug 2011 01:57:43 +0000 Subject: [PATCH] Patch from Paul Franklin - Partial work for: 0004646: reports cannot be run from the command line in a non-GUI environment svn: r18047 --- src/gen/plug/__init__.py | 5 +- src/gen/plug/_options.py | 85 ++++++++++-- src/gen/plug/report/__init__.py | 1 + src/gen/plug/report/_options.py | 31 ++--- src/gramps.py | 7 +- src/gui/plug/__init__.py | 7 +- src/gui/plug/_guioptions.py | 123 ++++-------------- src/gui/plug/report/Makefile.am | 1 - src/gui/plug/report/__init__.py | 3 - src/gui/plug/report/_options.py | 61 --------- src/gui/plug/report/_reportdialog.py | 16 +-- src/plugins/Records.py | 2 +- src/plugins/drawreport/AncestorTree.py | 4 +- src/plugins/drawreport/Calendar.py | 2 +- src/plugins/drawreport/DescendTree.py | 4 +- src/plugins/drawreport/FanChart.py | 2 +- src/plugins/drawreport/StatisticsChart.py | 2 +- src/plugins/drawreport/TimeLine.py | 2 +- src/plugins/graph/GVFamilyLines.py | 2 +- src/plugins/graph/GVHourGlass.py | 2 +- src/plugins/graph/GVRelGraph.py | 2 +- src/plugins/textreport/AncestorReport.py | 2 +- src/plugins/textreport/BirthdayReport.py | 2 +- src/plugins/textreport/CustomBookText.py | 2 +- src/plugins/textreport/DescendReport.py | 2 +- src/plugins/textreport/DetAncestralReport.py | 2 +- src/plugins/textreport/DetDescendantReport.py | 2 +- src/plugins/textreport/EndOfLineReport.py | 2 +- src/plugins/textreport/FamilyGroup.py | 2 +- src/plugins/textreport/IndivComplete.py | 2 +- src/plugins/textreport/KinshipReport.py | 2 +- .../textreport/NumberOfAncestorsReport.py | 2 +- src/plugins/textreport/PlaceReport.py | 2 +- src/plugins/textreport/SimpleBookTitle.py | 2 +- src/plugins/textreport/Summary.py | 2 +- src/plugins/textreport/TagReport.py | 2 +- src/plugins/webreport/NarrativeWeb.py | 2 +- src/plugins/webreport/WebCal.py | 2 +- 38 files changed, 157 insertions(+), 241 deletions(-) delete mode 100644 src/gui/plug/report/_options.py diff --git a/src/gen/plug/__init__.py b/src/gen/plug/__init__.py index 51ff975b2..4fcce9acb 100644 --- a/src/gen/plug/__init__.py +++ b/src/gen/plug/__init__.py @@ -18,6 +18,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + """ The "plug" package for handling plugins in Gramps. """ @@ -39,7 +41,8 @@ from _export import ExportPlugin from _docgenplugin import DocGenPlugin from _gramplet import Gramplet from utils import * -from gen.plug._options import Options, OptionListCollection, OptionList, OptionHandler +from _options import (Options, OptionListCollection, OptionList, + OptionHandler, MenuOptions) __all__ = [ "docbackend", "docgen", "menu", Plugin, PluginData, PluginRegister, BasePluginManager, diff --git a/src/gen/plug/_options.py b/src/gen/plug/_options.py index eedd9e1de..930d12bb8 100644 --- a/src/gen/plug/_options.py +++ b/src/gen/plug/_options.py @@ -3,6 +3,7 @@ # # Copyright (C) 2004-2005 Donald N. Allingham # Copyright (C) 2010 Jakim Friant +# Copyright (C) 2011 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,6 +52,7 @@ except: # #------------------------------------------------------------------------- import Utils +import gen #------------------------------------------------------------------------- # @@ -337,7 +339,7 @@ class OptionHandler(object): bad_opts = [] for option_name, option_data in options.iteritems(): if option_name not in self.options_dict: - print "Option %s is present in the %s but is not known "\ + print "Option '%s' is present in %s but is not known "\ "to the module." % (option_name, self.option_list_collection.filename) print "Ignoring..." @@ -441,17 +443,11 @@ class Options(object): """ self.handler = OptionHandler(self.name,self.options_dict,self.person_id) - def add_user_options(self,dialog): + def add_user_options(self): """ Set up UI controls (widgets) for the options specific for this modul. This method MUST be overridden by modules that define new options. - The single argument 'dialog' is the Report.ReportDialog instance. - Any attribute of the dialog is available. - - After the widgets are defined, they MUST be added to the dialog - using the following call: - dialog.add_options(LABEL,widget) NOTE: To really have any effect besides looking pretty, each widget set up here must be also parsed in the parse_user_options() @@ -459,13 +455,11 @@ class Options(object): """ pass - def parse_user_options(self,dialog): + def parse_user_options(self): """ Parses UI controls (widgets) for the options specific for this module. This method MUST be overridden by modules that define new options. - The single argument 'dialog' is the Report.ReportDialog instance. - Any attribute of the dialog is available. After obtaining values from the widgets, they MUST be used to set the appropriate options_dict values. Otherwise the values will not have @@ -475,3 +469,72 @@ class Options(object): in the add_user_options() method above. """ pass + +#------------------------------------------------------------------------ +# +# MenuOptions class +# +#------------------------------------------------------------------------ +class MenuOptions(object): + """ + Introduction + ============ + A MenuOptions is used to implement the necessary functions for adding + options to a menu. + """ + def __init__(self): + self.menu = gen.plug.menu.Menu() + + # Fill options_dict with report/tool defaults: + self.options_dict = {} + self.options_help = {} + self.add_menu_options(self.menu) + for name in self.menu.get_all_option_names(): + option = self.menu.get_option_by_name(name) + self.options_dict[name] = option.get_value() + self.options_help[name] = [ "", option.get_help() ] + + def make_default_style(self, default_style): + """ + This function is currently required by some reports. + """ + pass + + def add_menu_options(self, menu): + """ + Add the user defined options to the menu. + + @param menu: A menu class for the options to belong to. + @type menu: Menu + @return: nothing + """ + raise NotImplementedError + + def add_menu_option(self, category, name, option): + """ + Add a single option to the menu. + """ + self.menu.add_option(category, name, option) + self.options_dict[name] = option.get_value() + self.options_help[name] = [ "", option.get_help() ] + + def add_user_options(self): + """ + Generic method to add user options to the menu. + """ + for category in self.menu.get_categories(): + for name in self.menu.get_option_names(category): + option = self.menu.get_option(category, name) + + # override option default with xml-saved value: + if name in self.options_dict: + option.set_value(self.options_dict[name]) + + def parse_user_options(self): + """ + Load the changed values into the saved options. + """ + for name in self.menu.get_all_option_names(): + option = self.menu.get_option_by_name(name) + self.options_dict[name] = option.get_value() + diff --git a/src/gen/plug/report/__init__.py b/src/gen/plug/report/__init__.py index 5404f74df..cf817591d 100644 --- a/src/gen/plug/report/__init__.py +++ b/src/gen/plug/report/__init__.py @@ -32,3 +32,4 @@ from _reportbase import Report from _bibliography import Bibliography, Citation +from _options import MenuReportOptions diff --git a/src/gen/plug/report/_options.py b/src/gen/plug/report/_options.py index 5c87ed32a..7fc51fcca 100644 --- a/src/gen/plug/report/_options.py +++ b/src/gen/plug/report/_options.py @@ -4,6 +4,7 @@ # Copyright (C) 2004-2007 Donald N. Allingham # Copyright (C) 2008,2011 Gary Burton # Copyright (C) 2010 Jakim Friant +# Copyright (C) 2011 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -53,12 +54,14 @@ except: # # gramps modules # +# (do not import anything from 'gui' as this is in 'gen') +# #------------------------------------------------------------------------- import const import config from gen.plug.docgen import PAPER_PORTRAIT from gen.plug import _options -from gui.plug import GuiMenuOptions +from gen.plug import MenuOptions #------------------------------------------------------------------------- # @@ -789,44 +792,26 @@ class ReportOptions(_options.Options): """ self.handler.output = val - def init_selection(self, dbstate, uistate): - """ - Initialize selection options for GUI. - """ - pass - - def save_selection(self): - """ - Move selection options to handler. - """ - pass - - def build_selection(self): - """ - Move selection options to handler. - """ - pass - #------------------------------------------------------------------------- # # MenuReportOptions # #------------------------------------------------------------------------- -class MenuReportOptions(GuiMenuOptions, ReportOptions): +class MenuReportOptions(MenuOptions, ReportOptions): """ The MenuReportOptions class implements the ReportOptions functionality in a generic way so that the user does not need to - be concerned with the graphical representation of the options. + be concerned with the actual representation of the options. The user should inherit the MenuReportOptions class and override the add_menu_options function. The user can add options to the menu and the - MenuReportOptions class will worry about setting up the GUI. + MenuReportOptions class will worry about setting up the UI. """ def __init__(self, name, dbase): ReportOptions.__init__(self, name, dbase) - GuiMenuOptions.__init__(self) + MenuOptions.__init__(self) def load_previous_values(self): ReportOptions.load_previous_values(self) diff --git a/src/gramps.py b/src/gramps.py index 5f1a66dd2..420b77557 100644 --- a/src/gramps.py +++ b/src/gramps.py @@ -169,6 +169,10 @@ def show_settings(): except ImportError: gtkver_str = 'not found' pygtkver_str = 'not found' + # no DISPLAY is a RuntimeError in an older pygtk (e.g. 2.17 in Fedora 14) + except RuntimeError: + gtkver_str = 'DISPLAY not set' + pygtkver_str = 'DISPLAY not set' #exept TypeError: To handle back formatting on version split try: @@ -333,7 +337,8 @@ def run(): return error from cli.argparser import ArgParser - argpars = ArgParser(sys.argv) + argv_copy = sys.argv[:] + argpars = ArgParser(argv_copy) if argpars.need_gui(): #A GUI is needed, set it up diff --git a/src/gui/plug/__init__.py b/src/gui/plug/__init__.py index 252ec729e..c4c177358 100644 --- a/src/gui/plug/__init__.py +++ b/src/gui/plug/__init__.py @@ -29,13 +29,14 @@ __date__ ="$Apr 20, 2010 3:13:24 PM$" from gui.plug import tool -from _guioptions import GuiMenuOptions, make_gui_option +from _guioptions import make_gui_option, add_gui_options +from gen.plug import MenuOptions from _dialogs import ReportPluginDialog, ToolPluginDialog import _windows as PluginWindows # This needs to go above Tool and MenuOption as it needs both -class MenuToolOptions(GuiMenuOptions, tool.ToolOptions): +class MenuToolOptions(MenuOptions, tool.ToolOptions): """ The MenuToolOptions class implements the ToolOptions functionality in a generic way so that the user does not need to @@ -47,4 +48,4 @@ class MenuToolOptions(GuiMenuOptions, tool.ToolOptions): """ def __init__(self, name, person_id=None, dbstate=None): tool.ToolOptions.__init__(self, name, person_id) - GuiMenuOptions.__init__(self) + MenuOptions.__init__(self) diff --git a/src/gui/plug/_guioptions.py b/src/gui/plug/_guioptions.py index e9afbc9c2..bbefe671b 100644 --- a/src/gui/plug/_guioptions.py +++ b/src/gui/plug/_guioptions.py @@ -7,6 +7,7 @@ # Copyright (C) 2009 Nick Hall # Copyright (C) 2010 Jakim Friant # Copyright (C) 2011 Adam Stein +# Copyright (C) 2011 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1849,102 +1850,6 @@ class GuiBooleanListOption(gtk.HBox): self.__option.disconnect(self.valuekey) self.__option = None -#------------------------------------------------------------------------ -# -# GuiMenuOptions class -# -#------------------------------------------------------------------------ -class GuiMenuOptions(object): - """ - Introduction - ============ - A GuiMenuOptions is used to implement the necessary functions for adding - options to a GTK dialog. - """ - def __init__(self): - self.menu = gen.plug.menu.Menu() - - # Fill options_dict with report/tool defaults: - self.options_dict = {} - self.options_help = {} - self.add_menu_options(self.menu) - for name in self.menu.get_all_option_names(): - option = self.menu.get_option_by_name(name) - self.options_dict[name] = option.get_value() - self.options_help[name] = [ "", option.get_help() ] - - def make_default_style(self, default_style): - """ - This function is currently required by some reports. - """ - pass - - def add_menu_options(self, menu): - """ - Add the user defined options to the menu. - - @param menu: A menu class for the options to belong to. - @type menu: Menu - @return: nothing - """ - raise NotImplementedError - - def add_menu_option(self, category, name, option): - """ - Add a single option to the menu. - """ - self.menu.add_option(category, name, option) - self.options_dict[name] = option.get_value() - self.options_help[name] = [ "", option.get_help() ] - - def add_user_options(self, dialog): - """ - Generic method to add user options to the gui. - """ - for category in self.menu.get_categories(): - for name in self.menu.get_option_names(category): - option = self.menu.get_option(category, name) - - # override option default with xml-saved value: - if name in self.options_dict: - option.set_value(self.options_dict[name]) - - widget, label = make_gui_option(option, dialog.dbstate, - dialog.uistate, dialog.track) - if widget is not None: - if label: - dialog.add_frame_option(category, - option.get_label(), - widget) - else: - dialog.add_frame_option(category, "", widget) - - def parse_user_options(self, dialog): # IGNORE:W0613 - dialog is unused - """ - Load the changed values into the saved options. - """ - for name in self.menu.get_all_option_names(): - option = self.menu.get_option_by_name(name) - self.options_dict[name] = option.get_value() - - def init_selection(self, dbstate, uistate): - """ - Initialize selection options for GUI. - """ - pass - - def save_selection(self): - """ - Move selection options to handler. - """ - pass - - def build_selection(self): - """ - Move selection options to handler. - """ - pass - #-----------------------------------------------------------------------------# # # # Table mapping menu types to gui widgets used in make_gui_option function # @@ -2001,3 +1906,29 @@ def make_gui_option(option, dbstate, uistate, track): widget = widget(option, dbstate, uistate, track) return widget, label + +def add_gui_options(dialog): + """ + Stand-alone function to add user options to the GUI. + """ + if not hasattr(dialog.options, "menu"): + return + menu = dialog.options.menu + options_dict = dialog.options.options_dict + for category in menu.get_categories(): + for name in menu.get_option_names(category): + option = menu.get_option(category, name) + + # override option default with xml-saved value: + if name in options_dict: + option.set_value(options_dict[name]) + + widget, label = make_gui_option(option, dialog.dbstate, + dialog.uistate, dialog.track) + if widget is not None: + if label: + dialog.add_frame_option(category, + option.get_label(), + widget) + else: + dialog.add_frame_option(category, "", widget) diff --git a/src/gui/plug/report/Makefile.am b/src/gui/plug/report/Makefile.am index 8a3f3dbda..72cd0e6cc 100644 --- a/src/gui/plug/report/Makefile.am +++ b/src/gui/plug/report/Makefile.am @@ -8,7 +8,6 @@ pkgdata_PYTHON = \ _drawreportdialog.py\ _fileentry.py\ _graphvizreportdialog.py\ - _options.py\ _papermenu.py\ _reportdialog.py\ _stylecombobox.py\ diff --git a/src/gui/plug/report/__init__.py b/src/gui/plug/report/__init__.py index 20494c2b2..134109520 100644 --- a/src/gui/plug/report/__init__.py +++ b/src/gui/plug/report/__init__.py @@ -30,6 +30,3 @@ from _reportdialog import report from _drawreportdialog import DrawReportDialog from _textreportdialog import TextReportDialog - -from _options import ReportOptions, MenuReportOptions - diff --git a/src/gui/plug/report/_options.py b/src/gui/plug/report/_options.py deleted file mode 100644 index 402c6feac..000000000 --- a/src/gui/plug/report/_options.py +++ /dev/null @@ -1,61 +0,0 @@ -# -# Gramps - a GTK+/GNOME based genealogy program -# -# Copyright (C) 2004-2007 Donald N. Allingham -# Copyright (C) 2008 Gary Burton -# Copyright (C) 2010 Jakim Friant -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# $Id$ - -# Written by Alex Roitman - -""" -Report option handling, including saving and parsing. -""" -from gen.plug.report._options import ReportOptions -from gui.plug import GuiMenuOptions - -#------------------------------------------------------------------------- -# -# MenuReportOptions -# -#------------------------------------------------------------------------- -class MenuReportOptions(GuiMenuOptions, ReportOptions): - """ - - The MenuReportOptions class implements the ReportOptions - functionality in a generic way so that the user does not need to - be concerned with the graphical representation of the options. - - The user should inherit the MenuReportOptions class and override the - add_menu_options function. The user can add options to the menu and the - MenuReportOptions class will worry about setting up the GUI. - - """ - def __init__(self, name, dbase): - ReportOptions.__init__(self, name, dbase) - GuiMenuOptions.__init__(self) - - def load_previous_values(self): - ReportOptions.load_previous_values(self) - # Pass the loaded values to the menu options so they will be displayed - # properly. - for optname in self.options_dict: - menu_option = self.menu.get_option_by_name(optname) - if menu_option: - menu_option.set_value(self.options_dict[optname]) - diff --git a/src/gui/plug/report/_reportdialog.py b/src/gui/plug/report/_reportdialog.py index e7af39778..e892d7331 100644 --- a/src/gui/plug/report/_reportdialog.py +++ b/src/gui/plug/report/_reportdialog.py @@ -4,6 +4,7 @@ # Copyright (C) 2001-2006 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant +# Copyright (C) 2011 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,6 +52,7 @@ from gen.ggettext import gettext as _ import config import Errors from gui.utils import ProgressMeter, open_file_with_default_application +from gui.plug import add_gui_options from QuestionDialog import ErrorDialog, OptionDialog from gen.plug.report import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, CATEGORY_CODE, CATEGORY_WEB, CATEGORY_GRAPHVIZ, @@ -168,7 +170,6 @@ class ReportDialog(ManagedWindow.ManagedWindow): self.options = option_class(self.raw_name, self.db) except TypeError: self.options = option_class - self.options.init_selection(self.dbstate, self.uistate) self.options.load_previous_values() def build_window_key(self, obj): @@ -232,7 +233,6 @@ class ReportDialog(ManagedWindow.ManagedWindow): self.window.vbox.add(self.notebook) self.setup_report_options_frame() - self.setup_selection_frame() self.setup_other_frames() self.notebook.set_current_page(0) @@ -255,14 +255,14 @@ class ReportDialog(ManagedWindow.ManagedWindow): It is called immediately before the window is displayed. All calls to add_option or add_frame_option should be called in this task.""" - self.options.add_user_options(self) + add_gui_options(self) def parse_user_options(self): """Called to allow parsing of added widgets. It is called when OK is pressed in a dialog. All custom widgets should provide a parsing code here.""" try: - self.options.parse_user_options(self) + self.options.parse_user_options() except: LOG.error("Failed to parse user options.", exc_info=True) @@ -371,13 +371,6 @@ class ReportDialog(ManagedWindow.ManagedWindow): style = self.options.handler.get_default_stylesheet_name() self.build_style_menu(style) - def setup_selection_frame(self): - widget = self.options.build_selection() - if widget: - l = gtk.Label("%s" % _("Selection Options")) - l.set_use_markup(True) - self.notebook.append_page(widget, l) - def setup_report_options_frame(self): """Set up the report options frame of the dialog. This function relies on several report_xxx() customization @@ -617,7 +610,6 @@ class ReportDialog(ManagedWindow.ManagedWindow): self.parse_user_options() # Save options - self.options.save_selection() self.options.handler.save_options() def on_cancel(self, *obj): diff --git a/src/plugins/Records.py b/src/plugins/Records.py index 9d0781483..57b0a8aa1 100644 --- a/src/plugins/Records.py +++ b/src/plugins/Records.py @@ -45,7 +45,7 @@ from gen.plug.menu import (BooleanOption, EnumeratedListOption, FilterOption, PersonOption, StringOption) from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from Utils import probably_alive #------------------------------------------------------------------------ diff --git a/src/plugins/drawreport/AncestorTree.py b/src/plugins/drawreport/AncestorTree.py index 59abfcebe..c95b26904 100644 --- a/src/plugins/drawreport/AncestorTree.py +++ b/src/plugins/drawreport/AncestorTree.py @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: Ancestor2.py +# $Id$ """Reports/Graphical Reports/Ancestor Tree""" @@ -57,7 +57,7 @@ from gen.plug.menu import PersonOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.display.name import displayer as name_displayer diff --git a/src/plugins/drawreport/Calendar.py b/src/plugins/drawreport/Calendar.py index 6bd6009de..fe2ee9849 100644 --- a/src/plugins/drawreport/Calendar.py +++ b/src/plugins/drawreport/Calendar.py @@ -48,7 +48,7 @@ from gen.plug.menu import (BooleanOption, StringOption, NumberOption, from gui.utils import ProgressMeter from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from Utils import probably_alive from DateHandler import displayer as _dd import GrampsLocale diff --git a/src/plugins/drawreport/DescendTree.py b/src/plugins/drawreport/DescendTree.py index 6d502d931..dd359fa99 100644 --- a/src/plugins/drawreport/DescendTree.py +++ b/src/plugins/drawreport/DescendTree.py @@ -21,7 +21,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: Descend2.py +# $Id$ """ Reports/Graphical Reports/Familial Tree @@ -52,7 +52,7 @@ from gen.plug.menu import FamilyOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions PT2CM = ReportUtils.pt2cm diff --git a/src/plugins/drawreport/FanChart.py b/src/plugins/drawreport/FanChart.py index fb9f67ccc..07a9a46bb 100644 --- a/src/plugins/drawreport/FanChart.py +++ b/src/plugins/drawreport/FanChart.py @@ -47,7 +47,7 @@ from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle, from gen.plug.menu import EnumeratedListOption, NumberOption, PersonOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import config #------------------------------------------------------------------------ diff --git a/src/plugins/drawreport/StatisticsChart.py b/src/plugins/drawreport/StatisticsChart.py index 61aa9c659..e09210b65 100644 --- a/src/plugins/drawreport/StatisticsChart.py +++ b/src/plugins/drawreport/StatisticsChart.py @@ -52,7 +52,7 @@ from gen.plug.menu import BooleanOption, NumberOption, EnumeratedListOption, \ FilterOption, PersonOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler from gui.utils import ProgressMeter diff --git a/src/plugins/drawreport/TimeLine.py b/src/plugins/drawreport/TimeLine.py index e0048eb8c..c71a0e822 100644 --- a/src/plugins/drawreport/TimeLine.py +++ b/src/plugins/drawreport/TimeLine.py @@ -41,7 +41,7 @@ from gen.ggettext import sgettext as _ from gen.plug.menu import PersonOption, FilterOption, EnumeratedListOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions pt2cm = ReportUtils.pt2cm from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle, FONT_SANS_SERIF, DASHED, PARA_ALIGN_CENTER) diff --git a/src/plugins/graph/GVFamilyLines.py b/src/plugins/graph/GVFamilyLines.py index 87a0b0395..3fdca4e4d 100644 --- a/src/plugins/graph/GVFamilyLines.py +++ b/src/plugins/graph/GVFamilyLines.py @@ -55,7 +55,7 @@ import ThumbNails from DateHandler import displayer as _dd from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.menu import (NumberOption, ColorOption, BooleanOption, EnumeratedListOption, PersonListOption, SurnameColorOption) diff --git a/src/plugins/graph/GVHourGlass.py b/src/plugins/graph/GVHourGlass.py index 96a50610b..7f2d16f78 100644 --- a/src/plugins/graph/GVHourGlass.py +++ b/src/plugins/graph/GVHourGlass.py @@ -44,7 +44,7 @@ from gen.plug.menu import (PersonOption, BooleanOption, NumberOption, EnumeratedListOption) from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler from gen.utils import get_birth_or_fallback, get_death_or_fallback diff --git a/src/plugins/graph/GVRelGraph.py b/src/plugins/graph/GVRelGraph.py index 0f7a499ee..611904156 100644 --- a/src/plugins/graph/GVRelGraph.py +++ b/src/plugins/graph/GVRelGraph.py @@ -51,7 +51,7 @@ from gen.plug.menu import (BooleanOption, EnumeratedListOption, FilterOption, PersonOption, ColorOption) from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.display.name import displayer as name_displayer import DateHandler import gen.lib diff --git a/src/plugins/textreport/AncestorReport.py b/src/plugins/textreport/AncestorReport.py index 9833a89e6..020507f9f 100644 --- a/src/plugins/textreport/AncestorReport.py +++ b/src/plugins/textreport/AncestorReport.py @@ -47,7 +47,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, PARA_ALIGN_CENTER) from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import TransUtils from libnarrate import Narrator from libtranslate import Translator, get_language_string diff --git a/src/plugins/textreport/BirthdayReport.py b/src/plugins/textreport/BirthdayReport.py index dfe81ff8b..e5fb88317 100644 --- a/src/plugins/textreport/BirthdayReport.py +++ b/src/plugins/textreport/BirthdayReport.py @@ -48,7 +48,7 @@ from gen.plug.menu import (BooleanOption, StringOption, NumberOption, from gui.utils import ProgressMeter from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from Utils import probably_alive import GrampsLocale from DateHandler import displayer as _dd diff --git a/src/plugins/textreport/CustomBookText.py b/src/plugins/textreport/CustomBookText.py index 9d7f6c4c3..fd7e0bca9 100644 --- a/src/plugins/textreport/CustomBookText.py +++ b/src/plugins/textreport/CustomBookText.py @@ -44,7 +44,7 @@ from gen.ggettext import gettext as _ #------------------------------------------------------------------------ from gen.plug.menu import TextOption from gen.plug.report import Report -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.docgen import (FontStyle, ParagraphStyle, FONT_SANS_SERIF, PARA_ALIGN_CENTER) diff --git a/src/plugins/textreport/DescendReport.py b/src/plugins/textreport/DescendReport.py index 4b1ea207c..7fd7b1d44 100644 --- a/src/plugins/textreport/DescendReport.py +++ b/src/plugins/textreport/DescendReport.py @@ -47,7 +47,7 @@ from gen.display.name import displayer as _nd from Errors import ReportError from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler import Sort from gen.utils import (get_birth_or_fallback, get_death_or_fallback, diff --git a/src/plugins/textreport/DetAncestralReport.py b/src/plugins/textreport/DetAncestralReport.py index 74790b030..4643f3092 100644 --- a/src/plugins/textreport/DetAncestralReport.py +++ b/src/plugins/textreport/DetAncestralReport.py @@ -50,7 +50,7 @@ from gen.plug.menu import BooleanOption, NumberOption, PersonOption, EnumeratedL from gen.plug.report import ( Report, Bibliography ) from gen.plug.report import endnotes from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler diff --git a/src/plugins/textreport/DetDescendantReport.py b/src/plugins/textreport/DetDescendantReport.py index 911a8dd95..823548342 100644 --- a/src/plugins/textreport/DetDescendantReport.py +++ b/src/plugins/textreport/DetDescendantReport.py @@ -53,7 +53,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, from gen.plug.report import (Report, Bibliography) from gen.plug.report import endnotes from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler diff --git a/src/plugins/textreport/EndOfLineReport.py b/src/plugins/textreport/EndOfLineReport.py index 8f2045124..d7956f627 100644 --- a/src/plugins/textreport/EndOfLineReport.py +++ b/src/plugins/textreport/EndOfLineReport.py @@ -43,7 +43,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle, from gen.plug.menu import PersonOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler #------------------------------------------------------------------------ diff --git a/src/plugins/textreport/FamilyGroup.py b/src/plugins/textreport/FamilyGroup.py index 3f20500a7..a6126375a 100644 --- a/src/plugins/textreport/FamilyGroup.py +++ b/src/plugins/textreport/FamilyGroup.py @@ -40,7 +40,7 @@ import gen.lib from gen.plug.menu import BooleanOption, FamilyOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle, TableCellStyle, FONT_SANS_SERIF, FONT_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) diff --git a/src/plugins/textreport/IndivComplete.py b/src/plugins/textreport/IndivComplete.py index e39e11fbf..baa2e2002 100644 --- a/src/plugins/textreport/IndivComplete.py +++ b/src/plugins/textreport/IndivComplete.py @@ -47,7 +47,7 @@ from gen.plug.menu import (BooleanOption, FilterOption, PersonOption, BooleanListOption) from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.report import Bibliography from gen.plug.report import endnotes as Endnotes from gen.display.name import displayer as _nd diff --git a/src/plugins/textreport/KinshipReport.py b/src/plugins/textreport/KinshipReport.py index 81b3a84bc..74ecbb192 100644 --- a/src/plugins/textreport/KinshipReport.py +++ b/src/plugins/textreport/KinshipReport.py @@ -45,7 +45,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, from gen.plug.menu import NumberOption, BooleanOption, PersonOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import DateHandler from gen.utils import get_birth_or_fallback, get_death_or_fallback diff --git a/src/plugins/textreport/NumberOfAncestorsReport.py b/src/plugins/textreport/NumberOfAncestorsReport.py index 7a6865a50..2f1f1904b 100644 --- a/src/plugins/textreport/NumberOfAncestorsReport.py +++ b/src/plugins/textreport/NumberOfAncestorsReport.py @@ -49,7 +49,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, INDEX_TYPE_TOC) from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions #------------------------------------------------------------------------ # diff --git a/src/plugins/textreport/PlaceReport.py b/src/plugins/textreport/PlaceReport.py index 4059b0a9c..ecabb08c9 100644 --- a/src/plugins/textreport/PlaceReport.py +++ b/src/plugins/textreport/PlaceReport.py @@ -39,7 +39,7 @@ from gen.ggettext import gettext as _ from gen.plug.menu import FilterOption, PlaceListOption, EnumeratedListOption, \ BooleanOption from gen.plug.report import Report -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle, TableCellStyle, FONT_SANS_SERIF, FONT_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) diff --git a/src/plugins/textreport/SimpleBookTitle.py b/src/plugins/textreport/SimpleBookTitle.py index 9be55d4a6..b2d3ea4ae 100644 --- a/src/plugins/textreport/SimpleBookTitle.py +++ b/src/plugins/textreport/SimpleBookTitle.py @@ -37,7 +37,7 @@ from gen.ggettext import sgettext as _ from gen.plug.menu import StringOption, MediaOption, NumberOption from Utils import media_path_full from gen.plug.report import Report -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.docgen import (FontStyle, ParagraphStyle, FONT_SANS_SERIF, PARA_ALIGN_CENTER) diff --git a/src/plugins/textreport/Summary.py b/src/plugins/textreport/Summary.py index d9c6d5f12..ffa1a1dcf 100644 --- a/src/plugins/textreport/Summary.py +++ b/src/plugins/textreport/Summary.py @@ -42,7 +42,7 @@ from gen.ggettext import gettext as _ import gen.lib from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, FONT_SANS_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) from Utils import media_path_full diff --git a/src/plugins/textreport/TagReport.py b/src/plugins/textreport/TagReport.py index 0eddb55ba..2c89bbd51 100644 --- a/src/plugins/textreport/TagReport.py +++ b/src/plugins/textreport/TagReport.py @@ -40,7 +40,7 @@ from gen.ggettext import gettext as _ from gen.plug.menu import EnumeratedListOption from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle, TableCellStyle, FONT_SANS_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 6e2355c82..df7dc24a8 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -87,7 +87,7 @@ from gen.plug.menu import PersonOption, NumberOption, StringOption, \ NoteOption, MediaOption, DestinationOption from gen.plug.report import ( Report, Bibliography) from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions import Utils import constfunc diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index e5be41e5f..81a039415 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -53,7 +53,7 @@ import const import constfunc from gen.plug.report import Report from gen.plug.report import utils as ReportUtils -from gui.plug.report import MenuReportOptions +from gen.plug.report import MenuReportOptions from gen.plug.menu import BooleanOption, NumberOption, StringOption, \ EnumeratedListOption, FilterOption, PersonOption, \ DestinationOption, NoteOption