Switch from termcolor to colorama

This commit is contained in:
Micah Lee 2021-06-10 10:24:28 -07:00
parent 429f5dcf43
commit 46c73329a5
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
4 changed files with 14 additions and 7 deletions

View file

@ -5,7 +5,7 @@
Install dependencies: Install dependencies:
```sh ```sh
sudo apt install -y dh-python python3 python3-stdeb python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs python3-click python3-xdg python3-requests python3-termcolor sudo apt install -y dh-python python3 python3-stdeb python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs python3-click python3-xdg python3-requests python3-colorama
``` ```
You also need docker, either by installing the [Docker snap package](https://snapcraft.io/docker), installing the `docker.io` package, or by installing `docker-ce` by following [these instructions for Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/) or [for Debian](https://docs.docker.com/install/linux/docker-ce/debian/). You also need docker, either by installing the [Docker snap package](https://snapcraft.io/docker), installing the `docker.io` package, or by installing `docker-ce` by following [these instructions for Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/) or [for Debian](https://docs.docker.com/install/linux/docker-ce/debian/).
@ -27,7 +27,7 @@ Create a .deb:
Install dependencies: Install dependencies:
```sh ```sh
sudo dnf install -y rpm-build python3 python3-pyside2 python3-appdirs python3-click python3-pyxdg python3-requests python3-termcolor sudo dnf install -y rpm-build python3 python3-pyside2 python3-appdirs python3-click python3-pyxdg python3-requests python3-colorama
``` ```
You also need docker, either by installing the `docker` package, or by installing `docker-ce` by following [these instructions](https://docs.docker.com/install/linux/docker-ce/fedora/). You also need docker, either by installing the `docker` package, or by installing `docker-ce` by following [these instructions](https://docs.docker.com/install/linux/docker-ce/fedora/).
@ -61,7 +61,14 @@ poetry install
Run from source tree: Run from source tree:
``` ```
poetry run dangerzone # start a shell in the virtual environment
poetry shell
# run the CLI
./dev_scripts/dangerzone-cli --help
# run the GUI
./dev_scripts/dangerzone
``` ```
To create an app bundle, use the `build_app.py` script: To create an app bundle, use the `build_app.py` script:

View file

@ -4,7 +4,7 @@ import os
import pipes import pipes
import platform import platform
from PySide2 import QtCore, QtWidgets, QtGui from PySide2 import QtCore, QtWidgets, QtGui
from termcolor import cprint from colorama import Style
class TaskBase(QtCore.QThread): class TaskBase(QtCore.QThread):
@ -27,7 +27,7 @@ class TaskBase(QtCore.QThread):
self.update_details.emit(output) self.update_details.emit(output)
stderr = p.stderr.read().decode() stderr = p.stderr.read().decode()
cprint(stderr, attrs=["dark"]) print(Style.DIM + stderr + Style.RESET_ALL)
self.update_details.emit(output) self.update_details.emit(output)
if p.returncode == 126 or p.returncode == 127: if p.returncode == 126 or p.returncode == 127:

View file

@ -31,7 +31,7 @@ def main():
print("* Building RPM package") print("* Building RPM package")
subprocess.run( subprocess.run(
"python3 setup.py bdist_rpm --requires='python3-pyside2,python3-appdirs,python3-click,python3-pyxdg,python3-requests,python3-termcolor,(docker or docker-ce)'", "python3 setup.py bdist_rpm --requires='python3-pyside2,python3-appdirs,python3-click,python3-pyxdg,python3-requests,python3-colorama,(docker or docker-ce)'",
shell=True, shell=True,
cwd=root, cwd=root,
check=True, check=True,

View file

@ -1,6 +1,6 @@
[DEFAULT] [DEFAULT]
Package3: dangerzone Package3: dangerzone
Depends3: python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-appdirs, python3-click, python3-xdg, python3-requests, python3-termcolor Depends3: python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-appdirs, python3-click, python3-xdg, python3-requests, python3-colorama
Build-Depends: dh-python, python3, python3-all Build-Depends: dh-python, python3, python3-all
Suite: bionic Suite: bionic
X-Python3-Version: >= 3.6 X-Python3-Version: >= 3.6