Merge pull request #6136 from radarhere/imageshow

Fixed calling DisplayViewer or XVViewer without a title
This commit is contained in:
Hugo van Kemenade 2022-03-24 07:35:59 +02:00 committed by GitHub
commit 3ce6501228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,8 +270,9 @@ class DisplayViewer(UnixViewer):
else: else:
raise TypeError("Missing required argument: 'path'") raise TypeError("Missing required argument: 'path'")
args = ["display"] args = ["display"]
if "title" in options: title = options.get("title")
args += ["-title", options["title"]] if title:
args += ["-title", title]
args.append(path) args.append(path)
subprocess.Popen(args) subprocess.Popen(args)
@ -368,8 +369,9 @@ class XVViewer(UnixViewer):
else: else:
raise TypeError("Missing required argument: 'path'") raise TypeError("Missing required argument: 'path'")
args = ["xv"] args = ["xv"]
if "title" in options: title = options.get("title")
args += ["-name", options["title"]] if title:
args += ["-name", title]
args.append(path) args.append(path)
subprocess.Popen(args) subprocess.Popen(args)