allow for get_dbname() returning None

This commit is contained in:
Paul Franklin 2015-09-21 10:54:20 -07:00
parent cfa76465b5
commit f9ecd4b622
2 changed files with 8 additions and 2 deletions

View File

@ -185,10 +185,13 @@ class DocReportDialog(ReportDialog):
ext = "" ext = ""
else: else:
spath = self.get_default_directory() spath = self.get_default_directory()
default_name = self.dbname + "_" + self.raw_name
if self.options.get_output(): if self.options.get_output():
base = os.path.basename(self.options.get_output()) base = os.path.basename(self.options.get_output())
else: 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) base = "%s.%s" % (default_name, ext)
spath = os.path.normpath(os.path.join(spath, base)) spath = os.path.normpath(os.path.join(spath, base))
self.target_fileentry.set_filename(spath) self.target_fileentry.set_filename(spath)

View File

@ -165,10 +165,13 @@ class GraphvizReportDialog(ReportDialog):
ext = "" ext = ""
else: else:
spath = self.get_default_directory() spath = self.get_default_directory()
default_name = self.dbname + "_" + self.raw_name
if self.options.get_output(): if self.options.get_output():
base = os.path.basename(self.options.get_output()) base = os.path.basename(self.options.get_output())
else: 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 base = "%s%s" % (default_name, ext) # "ext" already has a dot
spath = os.path.normpath(os.path.join(spath, base)) spath = os.path.normpath(os.path.join(spath, base))
self.target_fileentry.set_filename(spath) self.target_fileentry.set_filename(spath)