Returns the Dangerzone version string.
()
| 96 | |
| 97 | |
| 98 | def get_version() -> str: |
| 99 | """Returns the Dangerzone version string.""" |
| 100 | try: |
| 101 | with get_resource_path("version.txt").open() as f: |
| 102 | version = f.read().strip() |
| 103 | except FileNotFoundError: |
| 104 | # In dev mode, in Windows, get_resource_path doesn't work properly for the container, but luckily |
| 105 | # it doesn't need to know the version |
| 106 | version = "unknown" |
| 107 | return version |
| 108 | |
| 109 | |
| 110 | def replace_control_chars(untrusted_str: str, keep_newlines: bool = False) -> str: |