Skip to content
Snippets Groups Projects
Commit fca9b477 authored by Jakub Ružička's avatar Jakub Ružička
Browse files

distro: use blessed instead of blessings

parent 62dc9c48
No related branches found
No related tags found
1 merge request!149distro: Improve Debian packaging
class NullCallableString(str):
"""
This emulates blessings class for cases when blessings aren't available
This emulates blessed class for cases when blessed isn't available
"""
def __new__(cls):
return str.__new__(cls, '')
......@@ -13,7 +13,7 @@ class NullCallableString(str):
class PlainTerminal:
"""
Mock of blessings Terminal that ignores formatting
Mock of blessed Terminal that ignores formatting
"""
nullstr = NullCallableString()
......@@ -24,11 +24,14 @@ class PlainTerminal:
COLOR_TERMINAL = False
try:
import blessings
try:
import blessed
except Exception:
import blessings as blessed
# this can throw _curses.error: setupterm: could not find terminal
# better find out now
blessings.Terminal()
Terminal = blessings.Terminal
blessed.Terminal()
Terminal = blessed.Terminal
COLOR_TERMINAL = True
except Exception:
Terminal = PlainTerminal
......@@ -10,7 +10,7 @@ license=('GPL3')
depends=('python-click'
'python-distro'
'python-toml'
'python-blessings')
'python-blessed')
#checkdepends=('python-pytest')
source=("${pkgname}-v${pkgver}.tar.gz")
sha256sums=('SKIP')
......
......@@ -18,7 +18,7 @@ python3Packages.buildPythonApplication rec {
propagatedBuildInputs = with python3Packages; [
# copy&pasted requirements.txt (almost exactly)
beautifulsoup4 # upstream version detection
blessings # terminal colors
blessed # terminal colors
build # apkg distribution
cached-property # for python <= 3.7; but pip complains even with 3.8
click # nice CLI framework
......
......@@ -50,8 +50,8 @@ This package contains apkg module for Python 3.
%prep
%autosetup -n %{name}-v%{version} -S git
# blessings are in install_requires for PyPI, but they're optional for colors
sed -i '/blessings/d' setup.cfg
# blessed are in install_requires for PyPI, but they're optional for colors
sed -i '/blessed/d' setup.cfg
%build
%py3_build
......
beautifulsoup4 # upstream version detection
blessings # terminal colors
blessed # terminal colors
build # apkg distribution
cached_property # @cached_property for python <= 3.7
click # nice CLI framework
......
......@@ -25,7 +25,7 @@ classifiers =
packages = find:
install_requires =
beautifulsoup4
blessings
blessed
cached_property
click
distro
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment