Skip to content

Commit

Permalink
Enable color output for logging under Windows
Browse files Browse the repository at this point in the history
Specifically with Windows CMD.
  • Loading branch information
clach04 authored and eylles committed Oct 12, 2024
1 parent 37409dd commit c7e5254
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pywal/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
import shutil
import sys

try:
import colorama
colorama.just_fix_windows_console() # NOOP for non-Windows
except ImportError:
pass

from .settings import __version__, CACHE_DIR, CONF_DIR
from . import colors
from . import export
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
print("error: pywal requires Python 3.5 or greater.")
sys.exit(1)

is_win = sys.platform.startswith('win')

LONG_DESC = open('README.md').read()
VERSION = pywal.__version__
DOWNLOAD = "https://github.com/eylles/pywal16/archive/%s.tar.gz" % VERSION

install_requires = []
if is_win:
install_requires += ['colorama']

setuptools.setup(
name="pywal16",
version=VERSION,
Expand All @@ -34,6 +40,7 @@
packages=["pywal"],
entry_points={"console_scripts": ["wal=pywal.__main__:main"]},
python_requires=">=3.5",
install_requires=install_requires,
extras_require={
'colorthief': ['colorthief', ], # known to work with 0.2.1
'colorz': ['colorz', ], # NOTE heavy, scipy dependency
Expand Down

0 comments on commit c7e5254

Please sign in to comment.