mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-18 11:11:49 +02:00
Merge b2f4e2d523
into 23f3ad1f46
This commit is contained in:
commit
4449defccc
8 changed files with 435 additions and 394 deletions
|
@ -335,9 +335,9 @@ class IsolationProvider(ABC):
|
||||||
stderr_thread = self.start_stderr_thread(p, stderr)
|
stderr_thread = self.start_stderr_thread(p, stderr)
|
||||||
|
|
||||||
if platform.system() != "Windows":
|
if platform.system() != "Windows":
|
||||||
assert os.getpgid(p.pid) != os.getpgid(
|
assert os.getpgid(p.pid) != os.getpgid(os.getpid()), (
|
||||||
os.getpid()
|
"Parent shares same PGID with child"
|
||||||
), "Parent shares same PGID with child"
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
yield p
|
yield p
|
||||||
|
|
|
@ -5,11 +5,14 @@ import sys
|
||||||
import traceback
|
import traceback
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
||||||
import appdirs
|
try:
|
||||||
|
import platformdirs
|
||||||
|
except ImportError:
|
||||||
|
import appdirs as platformdirs
|
||||||
|
|
||||||
|
|
||||||
def get_config_dir() -> str:
|
def get_config_dir() -> str:
|
||||||
return appdirs.user_config_dir("dangerzone")
|
return platformdirs.user_config_dir("dangerzone")
|
||||||
|
|
||||||
|
|
||||||
def get_resource_path(filename: str) -> str:
|
def get_resource_path(filename: str) -> str:
|
||||||
|
|
2
debian/control
vendored
2
debian/control
vendored
|
@ -9,7 +9,7 @@ Rules-Requires-Root: no
|
||||||
|
|
||||||
Package: dangerzone
|
Package: dangerzone
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${misc:Depends}, ${python3:Depends}, podman, python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-pyside2.qtsvg, python3-appdirs, python3-click, python3-xdg, python3-colorama, python3-requests, python3-markdown, python3-packaging, tesseract-ocr-all
|
Depends: ${misc:Depends}, podman, python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-pyside2.qtsvg, python3-platformdirs | python3-appdirs, python3-click, python3-xdg, python3-colorama, python3-requests, python3-markdown, python3-packaging, tesseract-ocr-all
|
||||||
Description: Take potentially dangerous PDFs, office documents, or images
|
Description: Take potentially dangerous PDFs, office documents, or images
|
||||||
Dangerzone is an open source desktop application that takes potentially dangerous PDFs, office documents, or images and converts them to safe PDFs. It uses disposable VMs on Qubes OS, or container technology in other OSes, to convert the documents within a secure sandbox.
|
Dangerzone is an open source desktop application that takes potentially dangerous PDFs, office documents, or images and converts them to safe PDFs. It uses disposable VMs on Qubes OS, or container technology in other OSes, to convert the documents within a secure sandbox.
|
||||||
.
|
.
|
||||||
|
|
|
@ -226,6 +226,11 @@ convert the documents within a secure sandbox.
|
||||||
sed -i 's/<3.13/<3.14/' pyproject.toml
|
sed -i 's/<3.13/<3.14/' pyproject.toml
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Bypass the version pin for Fedora as the 6.8.1.1 package is causing trouble
|
||||||
|
# A 6.8.1.1 package was only released with a wheel for macOS, but was picked by
|
||||||
|
# Fedora packagers. We cannot use "*" when PyPI is involved as it will fail to download the latest version.
|
||||||
|
# For Fedora, we can pick any of the released versions.
|
||||||
|
sed -i '/shiboken6 = \[/,/\]/c\shiboken6 = "*"' pyproject.toml
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
%pyproject_buildrequires -R
|
%pyproject_buildrequires -R
|
||||||
|
|
792
poetry.lock
generated
792
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -15,7 +15,7 @@ include = [
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.9,<3.13"
|
python = ">=3.9,<3.13"
|
||||||
click = "*"
|
click = "*"
|
||||||
appdirs = "*"
|
platformdirs = "*"
|
||||||
PySide6 = "^6.7.1"
|
PySide6 = "^6.7.1"
|
||||||
PyMuPDF = "^1.23.3" # The version in Fedora 39
|
PyMuPDF = "^1.23.3" # The version in Fedora 39
|
||||||
colorama = "*"
|
colorama = "*"
|
||||||
|
@ -23,6 +23,13 @@ pyxdg = {version = "*", platform = "linux"}
|
||||||
requests = "*"
|
requests = "*"
|
||||||
markdown = "*"
|
markdown = "*"
|
||||||
packaging = "*"
|
packaging = "*"
|
||||||
|
# shiboken6 released a 6.8.1.1 version only for macOS
|
||||||
|
# and it's getting picked by poetry, so pin it instead.
|
||||||
|
shiboken6 = [
|
||||||
|
{version = "*", platform = "darwin"},
|
||||||
|
{version = "<6.8.1.1", platform = "linux"},
|
||||||
|
{version = "<6.8.1.1", platform = "win32"},
|
||||||
|
]
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
dangerzone = 'dangerzone:main'
|
dangerzone = 'dangerzone:main'
|
||||||
|
|
|
@ -12,9 +12,9 @@ VERSION_FILE_NAME = "version.txt"
|
||||||
def test_get_resource_path() -> None:
|
def test_get_resource_path() -> None:
|
||||||
share_dir = Path("share").resolve()
|
share_dir = Path("share").resolve()
|
||||||
resource_path = Path(util.get_resource_path(VERSION_FILE_NAME)).parent
|
resource_path = Path(util.get_resource_path(VERSION_FILE_NAME)).parent
|
||||||
assert share_dir.samefile(
|
assert share_dir.samefile(resource_path), (
|
||||||
resource_path
|
f"{share_dir} is not the same file as {resource_path}"
|
||||||
), f"{share_dir} is not the same file as {resource_path}"
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(platform.system() != "Windows", reason="Windows-specific")
|
@pytest.mark.skipif(platform.system() != "Windows", reason="Windows-specific")
|
||||||
|
|
Loading…
Reference in a new issue