Remove temporary directory output

This commit is contained in:
Micah Lee 2021-06-08 15:29:34 -07:00
parent 2f97f344a9
commit 803844e832
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 11 additions and 12 deletions

View file

@ -30,10 +30,6 @@ class Common(object):
prefix=os.path.join(cache_dir, "safe-") prefix=os.path.join(cache_dir, "safe-")
) )
print(
f"Temporary directories created, dangerous={self.pixel_dir.name}, safe={self.safe_dir.name}"
)
# Name of input and out files # Name of input and out files
self.document_filename = None self.document_filename = None
self.save_filename = None self.save_filename = None

View file

@ -42,9 +42,6 @@ class GlobalCommon(object):
prefix="/tmp/dangerzone-pixel-" prefix="/tmp/dangerzone-pixel-"
) )
self.safe_dir = tempfile.TemporaryDirectory(prefix="/tmp/dangerzone-safe-") self.safe_dir = tempfile.TemporaryDirectory(prefix="/tmp/dangerzone-safe-")
print(
f"Temporary directories created, dangerous={self.pixel_dir.name}, safe={self.safe_dir.name}"
)
# Name of input file # Name of input file
self.document_filename = None self.document_filename = None
@ -279,9 +276,13 @@ class GlobalCommon(object):
) )
else: else:
if platform.system() == "Darwin": if platform.system() == "Darwin":
return os.path.join(os.path.dirname(sys.executable), "dangerzone-container") return os.path.join(
os.path.dirname(sys.executable), "dangerzone-container"
)
elif platform.system() == "Windows": elif platform.system() == "Windows":
return os.path.join(os.path.dirname(sys.executable), "dangerzone-container.exe") return os.path.join(
os.path.dirname(sys.executable), "dangerzone-container.exe"
)
else: else:
return "/usr/bin/dangerzone-container" return "/usr/bin/dangerzone-container"
@ -366,10 +367,12 @@ class GlobalCommon(object):
continue continue
with open(plist_path, "rb") as f: with open(plist_path, "rb") as f:
plist_data = f.read() plist_dict = plistlib.load(plist_path)
plist_dict = plistlib.loads(plist_data)
if plist_dict.get("CFBundleName") and plist_dict["CFBundleName"] != "Dangerzone": if (
plist_dict.get("CFBundleName")
and plist_dict["CFBundleName"] != "Dangerzone"
):
pdf_viewers[plist_dict["CFBundleName"]] = bundle_identifier pdf_viewers[plist_dict["CFBundleName"]] = bundle_identifier
elif platform.system() == "Linux": elif platform.system() == "Linux":