diff --git a/gramps2/src/Merge/_MergePerson.py b/gramps2/src/Merge/_MergePerson.py index d4f677787..f76fa97de 100644 --- a/gramps2/src/Merge/_MergePerson.py +++ b/gramps2/src/Merge/_MergePerson.py @@ -42,7 +42,7 @@ import pango # #------------------------------------------------------------------------- import RelLib -from PluginUtils import ReportUtils +from ReportBase import ReportUtils import NameDisplay import const import DateHandler diff --git a/gramps2/src/PluginUtils/_PluginMgr.py b/gramps2/src/PluginUtils/_PluginMgr.py index f1390602d..d813b0363 100644 --- a/gramps2/src/PluginUtils/_PluginMgr.py +++ b/gramps2/src/PluginUtils/_PluginMgr.py @@ -43,6 +43,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- +from ReportBase import MODE_GUI, MODE_BKI, book_categories import Errors #------------------------------------------------------------------------- @@ -265,21 +266,20 @@ def register_report( The low-level functions (starting with '_') should not be used on their own. Instead, this function will call them as needed. """ - import _Report - (junk,standalone_task) = divmod(modes,2**_Report.MODE_GUI) + (junk,standalone_task) = divmod(modes,2**MODE_GUI) if standalone_task: _register_standalone(report_class,options_class,translated_name, name,category,description, status,author_name,author_email,unsupported) - (junk,book_item_task) = divmod(modes-standalone_task,2**_Report.MODE_BKI) + (junk,book_item_task) = divmod(modes-standalone_task,2**MODE_BKI) if book_item_task: - book_item_category = _Report.book_categories[category] + book_item_category = book_categories[category] register_book_item(translated_name,book_item_category, report_class,options_class,name,unsupported) (junk,command_line_task) = divmod(modes-standalone_task-book_item_task, - 2**_Report.MODE_CLI) + 2**MODE_CLI) if command_line_task: _register_cl_report(name,category,report_class,options_class, translated_name,unsupported) diff --git a/gramps2/src/ReportBase/_BareReportDialog.py b/gramps2/src/ReportBase/_BareReportDialog.py index 10269d244..3ac26a321 100644 --- a/gramps2/src/ReportBase/_BareReportDialog.py +++ b/gramps2/src/ReportBase/_BareReportDialog.py @@ -20,6 +20,12 @@ # $Id: _Report.py 6669 2006-05-15 15:53:42Z rshura $ +from types import ClassType, InstanceType +import gtk + +import NameDisplay +import BaseDoc +from _StyleComboBox import StyleComboBox class BareReportDialog: """ @@ -268,7 +274,7 @@ class BareReportDialog: label = gtk.Label('%s' % title) label.set_use_markup(True) self.window.vbox.pack_start(label, True, True, - ReportDialog.border_pad) + BareReportDialog.border_pad) def setup_target_frame(self): """Bare report dialog only uses Doc Options header.""" @@ -312,7 +318,7 @@ class BareReportDialog: label = gtk.Label("%s:" % _("Style")) label.set_alignment(0.0,0.5) - self.style_menu = GrampsStyleComboBox() + self.style_menu = StyleComboBox() self.style_button = gtk.Button("%s..." % _("Style Editor")) self.style_button.connect('clicked',self.on_style_edit_clicked) diff --git a/gramps2/src/ReportBase/_FileEntry.py b/gramps2/src/ReportBase/_FileEntry.py index 5e18cd42c..06656470c 100644 --- a/gramps2/src/ReportBase/_FileEntry.py +++ b/gramps2/src/ReportBase/_FileEntry.py @@ -20,6 +20,9 @@ # $Id: _Report.py 6669 2006-05-15 15:53:42Z rshura $ +import os +import gtk + class FileEntry(gtk.HBox): def __init__(self,defname,title): gtk.HBox.__init__(self) diff --git a/gramps2/src/ReportBase/_PaperMenu.py b/gramps2/src/ReportBase/_PaperMenu.py index c2894b2aa..b0be8f0a0 100644 --- a/gramps2/src/ReportBase/_PaperMenu.py +++ b/gramps2/src/ReportBase/_PaperMenu.py @@ -60,7 +60,7 @@ except: #------------------------------------------------------------------------- paper_sizes = [] -class GrampsPaperComboBox(gtk.ComboBox): +class PaperComboBox(gtk.ComboBox): def __init__(self): gtk.ComboBox.__init__(self,model=None) @@ -91,7 +91,7 @@ class GrampsPaperComboBox(gtk.ComboBox): key = self.store[active][0] return (self.mapping[key],key) -class GrampsOrientationComboBox(gtk.ComboBox): +class OrientationComboBox(gtk.ComboBox): def __init__(self): gtk.ComboBox.__init__(self,model=None) diff --git a/gramps2/src/ReportBase/_ReportDialog.py b/gramps2/src/ReportBase/_ReportDialog.py index 7c3dc5d2e..8f5d21c2f 100644 --- a/gramps2/src/ReportBase/_ReportDialog.py +++ b/gramps2/src/ReportBase/_ReportDialog.py @@ -20,7 +20,19 @@ # $Id: _Report.py 6669 2006-05-15 15:53:42Z rshura $ +import os +import gtk + +import Config +import Errors +from QuestionDialog import ErrorDialog, OptionDialog + +from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \ + CATEGORY_VIEW, CATEGORY_CODE, CATEGORY_WEB, standalone_categories from _BareReportDialog import BareReportDialog +from _FileEntry import FileEntry +from _PaperMenu import PaperComboBox, OrientationComboBox, paper_sizes +from _TemplateParser import _template_map, _default_template, _user_template class ReportDialog(BareReportDialog): """ @@ -298,10 +310,10 @@ class ReportDialog(BareReportDialog): self.paper_table.set_row_spacings(6) self.paper_table.set_border_width(6) - self.papersize_menu = _PaperMenu.GrampsPaperComboBox() + self.papersize_menu = PaperComboBox() self.papersize_menu.connect('changed',self.size_changed) - self.orientation_menu = _PaperMenu.GrampsOrientationComboBox() + self.orientation_menu = OrientationComboBox() l = gtk.Label("%s:" % _("Size")) l.set_alignment(0.0,0.5) @@ -337,7 +349,7 @@ class ReportDialog(BareReportDialog): l.set_alignment(0.0,0.5) self.paper_table.attach(l,5,6,1,2,gtk.SHRINK|gtk.FILL) - self.papersize_menu.set(_PaperMenu.paper_sizes, + self.papersize_menu.set(paper_sizes, self.options.handler.get_paper_name()) self.orientation_menu.set(self.options.handler.get_orientation()) @@ -577,8 +589,10 @@ def report(database,person,report_class,options_class, """ if category == CATEGORY_TEXT: + from _TextReportDialog import TextReportDialog dialog_class = TextReportDialog elif category == CATEGORY_DRAW: + from _DrawReportDialog import DrawReportDialog dialog_class = DrawReportDialog elif category in (CATEGORY_BOOK,CATEGORY_VIEW, CATEGORY_CODE,CATEGORY_WEB): diff --git a/gramps2/src/ReportBase/_StyleComboBox.py b/gramps2/src/ReportBase/_StyleComboBox.py index cd9a71d79..fcdfacca4 100644 --- a/gramps2/src/ReportBase/_StyleComboBox.py +++ b/gramps2/src/ReportBase/_StyleComboBox.py @@ -20,6 +20,8 @@ # $Id: _Report.py 6669 2006-05-15 15:53:42Z rshura $ +import gtk + #------------------------------------------------------------------------- # # StyleComboBox diff --git a/gramps2/src/ReportBase/_TextFormatComboBox.py b/gramps2/src/ReportBase/_TextFormatComboBox.py index 1bfc805b0..a27e4ef71 100644 --- a/gramps2/src/ReportBase/_TextFormatComboBox.py +++ b/gramps2/src/ReportBase/_TextFormatComboBox.py @@ -40,7 +40,7 @@ class TextFormatComboBox(gtk.ComboBox): out_pref = Config.get(Config.OUTPUT_PREFERENCE) index = 0 - _PluginMgr.textdoc_list.sort() + PluginUtils.textdoc_list.sort() active_index = 0 for item in PluginUtils.textdoc_list: if tables and item[2] == 0: @@ -72,7 +72,7 @@ class TextFormatComboBox(gtk.ComboBox): return PluginUtils.textdoc_list[self.get_active()][5] def get_printable(self): - return PluginUtil.textdoc_list[self.get_active()][6] + return PluginUtils.textdoc_list[self.get_active()][6] def get_clname(self): return PluginUtils.textdoc_list[self.get_active()][7] diff --git a/gramps2/src/ReportBase/__init__.py b/gramps2/src/ReportBase/__init__.py index a0332042a..2e14b96c2 100644 --- a/gramps2/src/ReportBase/__init__.py +++ b/gramps2/src/ReportBase/__init__.py @@ -35,5 +35,5 @@ from _CommandLineReport import cl_report from _DrawReportDialog import DrawReportDialog from _TextReportDialog import TextReportDialog -import _ReportOptions as ReportOptions +from _ReportOptions import ReportOptions import _ReportUtils as ReportUtils diff --git a/gramps2/src/plugins/AncestorReport.py b/gramps2/src/plugins/AncestorReport.py index 1aac252d9..711572fe1 100644 --- a/gramps2/src/plugins/AncestorReport.py +++ b/gramps2/src/plugins/AncestorReport.py @@ -35,7 +35,9 @@ from gettext import gettext as _ # gramps modules # #------------------------------------------------------------------------ -from PluginUtils import Report, ReportUtils, ReportOptions, register_report +from PluginUtils import register_report +from ReportBase import Report, ReportUtils, ReportOptions, \ + CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI import BaseDoc import Errors import NameDisplay @@ -53,7 +55,7 @@ def log2(val): # AncestorReport # #------------------------------------------------------------------------ -class AncestorReport(Report.Report): +class AncestorReport(Report): def __init__(self,database,person,options_class): """ @@ -73,7 +75,7 @@ class AncestorReport(Report.Report): """ - Report.Report.__init__(self,database,person,options_class) + Report.__init__(self,database,person,options_class) self.map = {} (self.max_generations,self.pgbrk) \ @@ -140,14 +142,14 @@ class AncestorReport(Report.Report): # # #------------------------------------------------------------------------ -class AncestorOptions(ReportOptions.ReportOptions): +class AncestorOptions(ReportOptions): """ Defines options and provides handling interface. """ def __init__(self,name,person_id=None): - ReportOptions.ReportOptions.__init__(self,name,person_id) + ReportOptions.__init__(self,name,person_id) def enable_options(self): # Semi-common options that should be enabled for this report @@ -194,10 +196,10 @@ class AncestorOptions(ReportOptions.ReportOptions): #------------------------------------------------------------------------ register_report( name = 'ancestor_report', - category = Report.CATEGORY_TEXT, + category = CATEGORY_TEXT, report_class = AncestorReport, options_class = AncestorOptions, - modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, + modes = MODE_GUI | MODE_BKI | MODE_CLI, translated_name = _("Ahnentafel Report"), status=(_("Stable")), description= _("Produces a textual ancestral report"),