From 803844e8327bb2891ae6c0f6ae5d44088708cddf Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 8 Jun 2021 15:29:34 -0700 Subject: [PATCH] Remove temporary directory output --- dangerzone/common.py | 4 ---- dangerzone/global_common.py | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dangerzone/common.py b/dangerzone/common.py index 637b26b..d50a51f 100644 --- a/dangerzone/common.py +++ b/dangerzone/common.py @@ -30,10 +30,6 @@ class Common(object): 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 self.document_filename = None self.save_filename = None diff --git a/dangerzone/global_common.py b/dangerzone/global_common.py index 0e4aa54..3310b59 100644 --- a/dangerzone/global_common.py +++ b/dangerzone/global_common.py @@ -42,9 +42,6 @@ class GlobalCommon(object): prefix="/tmp/dangerzone-pixel-" ) 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 self.document_filename = None @@ -279,9 +276,13 @@ class GlobalCommon(object): ) else: 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": - 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: return "/usr/bin/dangerzone-container" @@ -366,10 +367,12 @@ class GlobalCommon(object): continue with open(plist_path, "rb") as f: - plist_data = f.read() - plist_dict = plistlib.loads(plist_data) + plist_dict = plistlib.load(plist_path) - 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 elif platform.system() == "Linux":