mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Remove temporary directory output
This commit is contained in:
parent
2f97f344a9
commit
803844e832
2 changed files with 11 additions and 12 deletions
|
@ -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
|
||||||
|
|
|
@ -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":
|
||||||
|
|
Loading…
Reference in a new issue