mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Display banner
This commit is contained in:
parent
1144fd9f87
commit
918e5fa306
8 changed files with 183 additions and 7 deletions
|
@ -7,7 +7,7 @@ This section documents the release process. Unless you're a dangerzone developer
|
|||
Before making a release, all of these should be complete:
|
||||
|
||||
* Update `version` in `pyproject.toml`
|
||||
* Update `dangerzone_version` in `dangerzone/__init__.py`
|
||||
* Update in `share/version.txt`
|
||||
* Update version and download links in `README.md`
|
||||
* CHANGELOG.md should be updated to include a list of all major changes since the last release
|
||||
* There must be a PGP-signed git tag for the version, e.g. for dangerzone 0.1.0, the tag must be `v0.1.0`
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
dangerzone_version = "0.1.5"
|
||||
|
||||
# Depending on the filename, decide if we want to run:
|
||||
# dangerzone, dangerzone-cli, or dangerzone-container
|
||||
|
||||
|
|
|
@ -1,9 +1,174 @@
|
|||
import os
|
||||
import shutil
|
||||
import click
|
||||
import colorama
|
||||
from colorama import Fore, Back, Style
|
||||
|
||||
from .global_common import GlobalCommon
|
||||
from .common import Common
|
||||
from dangerzone import global_common
|
||||
|
||||
|
||||
def display_banner(global_common):
|
||||
"""
|
||||
Raw ASCII art example:
|
||||
╭──────────────────────────╮
|
||||
│ ▄██▄ │
|
||||
│ ██████ │
|
||||
│ ███▀▀▀██ │
|
||||
│ ███ ████ │
|
||||
│ ███ ██████ │
|
||||
│ ███ ▀▀▀▀████ │
|
||||
│ ███████ ▄██████ │
|
||||
│ ███████ ▄█████████ │
|
||||
│ ████████████████████ │
|
||||
│ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ │
|
||||
│ │
|
||||
│ Dangerzone v0.1.5 │
|
||||
│ https://dangerzone.rocks │
|
||||
╰──────────────────────────╯
|
||||
"""
|
||||
colorama.init(autoreset=True)
|
||||
print(Fore.YELLOW + Style.DIM + "╭──────────────────────────╮")
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ▄██▄ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ██████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ███▀▀▀██ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ███ ████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ███ ██████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ███ ▀▀▀▀████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ███████ ▄██████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ███████ ▄█████████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ████████████████████ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTYELLOW_EX
|
||||
+ Style.NORMAL
|
||||
+ " ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(Fore.YELLOW + Style.DIM + "│ │")
|
||||
left_spaces = (15 - len(global_common.version) - 1) // 2
|
||||
right_spaces = left_spaces
|
||||
if left_spaces + len(global_common.version) + 1 + right_spaces < 15:
|
||||
right_spaces += 1
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTWHITE_EX
|
||||
+ Style.RESET_ALL
|
||||
+ Style.BRIGHT
|
||||
+ f"{' '*left_spaces}Dangerzone v{global_common.version}{' '*right_spaces}"
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
+ Fore.LIGHTWHITE_EX
|
||||
+ Style.RESET_ALL
|
||||
+ " https://dangerzone.rocks "
|
||||
+ Fore.YELLOW
|
||||
+ Style.DIM
|
||||
+ "│"
|
||||
)
|
||||
print(Fore.YELLOW + Style.DIM + "╰──────────────────────────╯")
|
||||
|
||||
|
||||
def exec_container(global_common, args):
|
||||
|
@ -40,6 +205,8 @@ def cli_main(custom_container, safe_pdf_filename, ocr_lang, skip_update, filenam
|
|||
global_common = GlobalCommon()
|
||||
common = Common()
|
||||
|
||||
display_banner(global_common)
|
||||
|
||||
# Validate filename
|
||||
valid = True
|
||||
try:
|
||||
|
|
|
@ -16,6 +16,10 @@ class GlobalCommon(object):
|
|||
"""
|
||||
|
||||
def __init__(self):
|
||||
# Version
|
||||
with open(self.get_resource_path("version.txt")) as f:
|
||||
self.version = f.read().strip()
|
||||
|
||||
# App data folder
|
||||
self.appdata_path = appdirs.user_config_dir("dangerzone")
|
||||
|
||||
|
|
2
poetry.lock
generated
2
poetry.lock
generated
|
@ -374,7 +374,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pyt
|
|||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = ">=3.7,<3.10"
|
||||
content-hash = "26e6acc883dad4194c45e399fadaabc12730fdd3a7b2264737e4e81838183eee"
|
||||
content-hash = "72592722794667cf7cb6bea727b31eb60d710c90d488be9d10a13bbbcaa56688"
|
||||
|
||||
[metadata.files]
|
||||
altgraph = [
|
||||
|
|
|
@ -18,6 +18,7 @@ wmi = {version = "*", platform = "win32"}
|
|||
pyxdg = {version = "*", platform = "linux"}
|
||||
pyobjc-core = {version = "*", platform = "darwin"}
|
||||
pyobjc-framework-launchservices = {version = "*", platform = "darwin"}
|
||||
colorama = "^0.4.4"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
pyinstaller = {version = "*", platform = "darwin"}
|
||||
|
|
11
setup.py
11
setup.py
|
@ -2,7 +2,9 @@
|
|||
import setuptools
|
||||
import os
|
||||
import sys
|
||||
from dangerzone import dangerzone_version
|
||||
|
||||
with open("share/version.txt") as f:
|
||||
version = f.read().strip()
|
||||
|
||||
|
||||
def file_list(path):
|
||||
|
@ -15,7 +17,7 @@ def file_list(path):
|
|||
|
||||
setuptools.setup(
|
||||
name="dangerzone",
|
||||
version=dangerzone_version,
|
||||
version=version,
|
||||
author="Micah Lee",
|
||||
author_email="micah.lee@theintercept.com",
|
||||
license="MIT",
|
||||
|
@ -23,7 +25,10 @@ setuptools.setup(
|
|||
url="https://github.com/firstlookmedia/dangerzone",
|
||||
packages=["dangerzone"],
|
||||
data_files=[
|
||||
("share/applications", ["install/linux/media.firstlook.dangerzone.desktop"],),
|
||||
(
|
||||
"share/applications",
|
||||
["install/linux/media.firstlook.dangerzone.desktop"],
|
||||
),
|
||||
(
|
||||
"share/icons/hicolor/64x64/apps",
|
||||
["install/linux/media.firstlook.dangerzone.png"],
|
||||
|
|
1
share/version.txt
Normal file
1
share/version.txt
Normal file
|
@ -0,0 +1 @@
|
|||
0.2
|
Loading…
Reference in a new issue