mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00

As detected by [ruff](https://github.com/astral-sh/ruff) Related to #254, although it doesn't provide the command to lint the codebase itself.
16 lines
390 B
Python
16 lines
390 B
Python
import os
|
|
import sys
|
|
|
|
if "DANGERZONE_MODE" in os.environ:
|
|
mode = os.environ["DANGERZONE_MODE"]
|
|
else:
|
|
basename = os.path.basename(sys.argv[0])
|
|
if basename == "dangerzone-cli" or basename == "dangerzone-cli.exe":
|
|
mode = "cli"
|
|
else:
|
|
mode = "gui"
|
|
|
|
if mode == "cli":
|
|
from .cli import cli_main as main
|
|
else:
|
|
from .gui import gui_main as main # noqa: F401
|