From 17f8b4818c2c6eb8d29c63617244218ec56725ca Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Mon, 21 Sep 2015 10:53:25 -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 068770207..b38fafa7f 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 0adbb158c..9fbe901c6 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)