Skip to content

Commit ca4aaa2

Browse files
committed
Removed colorama dependency. This breaks the online build system, the live exported and prevents deployment of new platforms. Rewrite the code so colors are optional and no additional modules are required for toolchains and platforms
1 parent 014b0f1 commit ca4aaa2

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

workspace_tools/toolchains/__init__.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import re
1919
import sys
20-
import colorama
2120
from os import stat, walk
2221
from copy import copy
2322
from time import time, sleep
@@ -50,23 +49,6 @@ def print_notify(event, silent=False):
5049
if not silent:
5150
print '%s: %s' % (event['action'].title(), basename(event['file']))
5251

53-
def print_notify_color(event, silent=False):
54-
""" Default command line notification with colors
55-
"""
56-
from colorama import Fore, Back, Style
57-
58-
if event['type'] in ['info', 'debug']:
59-
print Fore.GREEN + event['message'] + Fore.RESET
60-
61-
elif event['type'] == 'cc':
62-
event['severity'] = event['severity'].title()
63-
event['file'] = basename(event['file'])
64-
print Fore.YELLOW + '[%(severity)s] %(file)s@%(line)s: %(message)s'% event + Fore.RESET
65-
66-
elif event['type'] == 'progress':
67-
if not silent:
68-
print '%s: %s' % (event['action'].title(), basename(event['file']))
69-
7052
def print_notify_verbose(event, silent=False):
7153
""" Default command line notification with more verbose mode
7254
"""
@@ -239,7 +221,7 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False)
239221

240222
self.legacy_ignore_dirs = LEGACY_IGNORE_DIRS - set([target.name, LEGACY_TOOLCHAIN_NAMES[self.name]])
241223

242-
self.notify_fun = notify if notify is not None else print_notify_color
224+
self.notify_fun = notify if notify is not None else print_notify
243225
self.options = options if options is not None else []
244226

245227
self.macros = macros or []
@@ -731,9 +713,6 @@ def tool_error(self, message):
731713
def var(self, key, value):
732714
self.notify({'type': 'var', 'key': key, 'val': value})
733715

734-
from colorama import init
735-
init()
736-
737716
from workspace_tools.settings import ARM_BIN
738717
from workspace_tools.settings import GCC_ARM_PATH, GCC_CR_PATH, GCC_CS_PATH, CW_EWL_PATH, CW_GCC_PATH
739718
from workspace_tools.settings import IAR_PATH

0 commit comments

Comments
 (0)