Skip to content

Commit

Permalink
Don't use LIGHT*_EX colors
Browse files Browse the repository at this point in the history
  • Loading branch information
aldanor committed Jun 10, 2015
1 parent 3ec1363 commit 0a24376
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pytest_watch/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .spooler import EventSpooler

from colorama import Fore
from colorama import Fore, Style
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
from watchdog.events import (FileSystemEventHandler, FileModifiedEvent,
Expand All @@ -23,6 +23,8 @@
DEFAULT_EXTENSIONS = ['.py']
CLEAR_COMMAND = 'cls' if os.name == 'nt' else 'clear'
BEEP_CHARACTER = '\a'
STYLE_NORMAL = Fore.WHITE + Style.NORMAL + Style.DIM
STYLE_HIGHLIGHT = Fore.CYAN + Style.NORMAL + Style.BRIGHT


class ChangeHandler(FileSystemEventHandler):
Expand Down Expand Up @@ -60,7 +62,7 @@ def run(self, summary=None):
if self.auto_clear:
subprocess.call(CLEAR_COMMAND)
command = ' '.join(['py.test'] + self.args)
highlight = lambda arg: Fore.LIGHTWHITE_EX + arg + Fore.CYAN
highlight = lambda arg: STYLE_HIGHLIGHT + arg + STYLE_NORMAL
msg = 'Running pytest command: {}'.format(highlight(command))
if summary:
msg = 'Changes detected in files:\n{}\n\nRerunning pytest command: {}'.format(
Expand All @@ -69,8 +71,8 @@ def run(self, summary=None):
for event_name, paths in summary),
highlight(command)
)
print()
print(Fore.CYAN + msg + Fore.RESET)
print()
print(STYLE_NORMAL + msg + Fore.RESET + Style.NORMAL)
if self.auto_clear:
print()
exit_code = subprocess.call(['py.test'] + self.args)
Expand Down

0 comments on commit 0a24376

Please sign in to comment.