From f9ecd4b622ca4110b715f4d512c2f5da8e8ba6b2 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Mon, 21 Sep 2015 10:54:20 -0700 Subject: [PATCH] allow for get_dbname() returning None --- gramps/gui/plug/report/_docreportdialog.py | 5 ++++- gramps/gui/plug/report/_graphvizreportdialog.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py index 7b49d4b67..f50221d5b 100644 --- a/gramps/gui/plug/report/_docreportdialog.py +++ b/gramps/gui/plug/report/_docreportdialog.py @@ -185,10 +185,13 @@ class DocReportDialog(ReportDialog): ext = "" else: spath = self.get_default_directory() - default_name = self.dbname + "_" + self.raw_name if self.options.get_output(): base = os.path.basename(self.options.get_output()) else: + if self.dbname is None: + default_name = self.raw_name + else: + default_name = self.dbname + "_" + self.raw_name base = "%s.%s" % (default_name, ext) spath = os.path.normpath(os.path.join(spath, base)) self.target_fileentry.set_filename(spath) diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py index 62197d6e3..d949ee45a 100644 --- a/gramps/gui/plug/report/_graphvizreportdialog.py +++ b/gramps/gui/plug/report/_graphvizreportdialog.py @@ -165,10 +165,13 @@ class GraphvizReportDialog(ReportDialog): ext = "" else: spath = self.get_default_directory() - default_name = self.dbname + "_" + self.raw_name if self.options.get_output(): base = os.path.basename(self.options.get_output()) else: + if self.dbname is None: + default_name = self.raw_name + else: + default_name = self.dbname + "_" + self.raw_name base = "%s%s" % (default_name, ext) # "ext" already has a dot spath = os.path.normpath(os.path.join(spath, base)) self.target_fileentry.set_filename(spath)