From 6fedb61f2f280c115a818a466ba3a15669a1b60a Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 31 Jan 2007 00:02:15 +0000 Subject: [PATCH] 2007-01-30 Don Allingham * src/ReportBase/_ReportDialog.py: error reporting * src/plugins/NarrativeWeb.py: error reporting * src/Filters/_SearchBar.py: numlock handling * src/Filters/SideBar/_SidebarFilter.py: numlock handling svn: r8016 --- gramps2/ChangeLog | 8 ++++++-- gramps2/src/ReportBase/_ReportDialog.py | 3 +++ gramps2/src/plugins/NarrativeWeb.py | 14 +++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 7b75d5c8c..196e3d482 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2007-01-30 Don Allingham + * src/ReportBase/_ReportDialog.py: error reporting + * src/plugins/NarrativeWeb.py: error reporting + 2007-01-30 Alex Roitman * configure.in: Bump up the version. @@ -8,8 +12,8 @@ 2007-01-29 Benny Malengier * src/DataViews/_PersonView.py: numlock handling * src/PageView.py: numlock handling - * src/Filters/_SearchBar.py: numblock handling - * src/Filters/SideBar/_SidebarFilter.py: numblock handling + * src/Filters/_SearchBar.py: numlock handling + * src/Filters/SideBar/_SidebarFilter.py: numlock handling 2007-01-29 Don Allingham * src/DataViews/_PersonView.py: refactoring diff --git a/gramps2/src/ReportBase/_ReportDialog.py b/gramps2/src/ReportBase/_ReportDialog.py index dd432892a..56bfac5cf 100644 --- a/gramps2/src/ReportBase/_ReportDialog.py +++ b/gramps2/src/ReportBase/_ReportDialog.py @@ -667,6 +667,9 @@ def report(dbstate,uistate,person,report_class,options_class, elif category in (CATEGORY_BOOK,CATEGORY_CODE,CATEGORY_VIEW,CATEGORY_WEB): try: report_class(dbstate,uistate,person) + except Error, msg: + ErrorDialog(_("Error generating report"), + str(msg)) except Errors.WindowActiveError: pass return diff --git a/gramps2/src/plugins/NarrativeWeb.py b/gramps2/src/plugins/NarrativeWeb.py index d6529f5cd..9e9b367c3 100644 --- a/gramps2/src/plugins/NarrativeWeb.py +++ b/gramps2/src/plugins/NarrativeWeb.py @@ -158,6 +158,7 @@ class BasePage: self.graphgens = options.handler.options_dict['NWEBgraphgens'] self.use_home = self.options.handler.options_dict['NWEBhomenote'] != "" self.page_title = "" + self.warn_dir = True def store_file(self,archive,html_dir,from_path,to_path): if archive: @@ -167,7 +168,18 @@ class BasePage: dirname = os.path.dirname(dest) if not os.path.isdir(dirname): os.makedirs(dirname) - shutil.copyfile(from_path,dest) + if from_path != dest: + shutil.copyfile(from_path,dest) + elif self.warn_dir: + WarningDialog( + _("Possible destination error") + _("You appear to have set your target directory " + "to a directory used for data storage. This " + "could create problems with file management. " + "It is recommended that you consider using " + "a different directory to store your generated " + "web pages.")) + self.warn_dir = False def copy_media(self,photo,store_ref=True):