GlobalCommon does not need temp dirs, and fix bug with finding Mac PFD viewers

This commit is contained in:
Micah Lee 2021-06-09 11:52:49 -07:00
parent 80d1d2e583
commit 791723db20
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -32,17 +32,6 @@ class GlobalCommon(object):
# Qt app
self.app = app
# Temporary directory to store pixel data
# Note in macOS, temp dirs must be in /tmp (or a few other paths) for Docker to mount them
if platform.system() == "Windows":
self.pixel_dir = tempfile.TemporaryDirectory(prefix="dangerzone-pixel-")
self.safe_dir = tempfile.TemporaryDirectory(prefix="dangerzone-safe-")
else:
self.pixel_dir = tempfile.TemporaryDirectory(
prefix="/tmp/dangerzone-pixel-"
)
self.safe_dir = tempfile.TemporaryDirectory(prefix="/tmp/dangerzone-safe-")
# Name of input file
self.document_filename = None
@ -367,7 +356,9 @@ class GlobalCommon(object):
continue
with open(plist_path, "rb") as f:
plist_dict = plistlib.load(plist_path)
plist_data = f.read()
plist_dict = plistlib.loads(plist_data)
if (
plist_dict.get("CFBundleName")