mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
qubes: Mark Dangerzone messages as trusted
Mark the messages that Dangerzone creates once a conversion step finishes as trusted, since they do not contain any string not controlled by us.
This commit is contained in:
parent
72536a05ac
commit
6c374d8a7e
1 changed files with 4 additions and 4 deletions
|
@ -120,11 +120,11 @@ class Qubes(IsolationProvider):
|
|||
percentage += percentage_per_page
|
||||
|
||||
text = f"Converting page {page}/{n_pages} to pixels"
|
||||
self.print_progress(document, False, text, percentage)
|
||||
self.print_progress_trusted(document, False, text, percentage)
|
||||
|
||||
# TODO handle leftover code input
|
||||
text = "Converted document to pixels"
|
||||
self.print_progress(document, False, text, percentage)
|
||||
self.print_progress_trusted(document, False, text, percentage)
|
||||
|
||||
# FIXME pass OCR stuff properly (see #455)
|
||||
old_environ = dict(os.environ)
|
||||
|
@ -133,13 +133,13 @@ class Qubes(IsolationProvider):
|
|||
os.environ["OCR_LANGUAGE"] = ocr_lang
|
||||
|
||||
def print_progress_wrapper(error: bool, text: str, percentage: float) -> None:
|
||||
self.print_progress(document, error, text, percentage)
|
||||
self.print_progress_trusted(document, error, text, percentage)
|
||||
|
||||
asyncio.run(PixelsToPDF(progress_callback=print_progress_wrapper).convert())
|
||||
|
||||
percentage = 100.0
|
||||
text = "Safe PDF created"
|
||||
self.print_progress(document, False, text, percentage)
|
||||
self.print_progress_trusted(document, False, text, percentage)
|
||||
|
||||
# FIXME remove once the OCR args are no longer passed with env vars
|
||||
os.environ.clear()
|
||||
|
|
Loading…
Reference in a new issue