Skip to content

Commit 83f8927

Browse files
committed
Use colorama on Windows
1 parent b6625f3 commit 83f8927

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

labelme/logger.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import datetime
22
import logging
3+
import os
34

45
import termcolor
56

7+
if os.name == "nt": # Windows
8+
import colorama
9+
10+
colorama.init()
11+
612
from . import __appname__
713

814

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from __future__ import print_function
22

33
import distutils.spawn
4+
import os
45
import re
5-
from setuptools import find_packages
6-
from setuptools import setup
76
import shlex
87
import subprocess
98
import sys
109

10+
from setuptools import find_packages
11+
from setuptools import setup
12+
1113

1214
def get_version():
1315
filename = "labelme/__init__.py"
@@ -75,6 +77,9 @@ def get_install_requires():
7577
QT_BINDING = "pyqt5"
7678
del QT_BINDING
7779

80+
if os.name == "nt": # Windows
81+
install_requires.append("colorama")
82+
7883
return install_requires
7984

8085

0 commit comments

Comments
 (0)