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

pull/922/head
Mihail Stoyanov 2015-02-19 17:09:07 +02:00
parent 014b0f1ca6
commit ca4aaa2dde
1 changed files with 1 additions and 22 deletions

View File

@ -17,7 +17,6 @@ limitations under the License.
import re import re
import sys import sys
import colorama
from os import stat, walk from os import stat, walk
from copy import copy from copy import copy
from time import time, sleep from time import time, sleep
@ -50,23 +49,6 @@ def print_notify(event, silent=False):
if not silent: if not silent:
print '%s: %s' % (event['action'].title(), basename(event['file'])) print '%s: %s' % (event['action'].title(), basename(event['file']))
def print_notify_color(event, silent=False):
""" Default command line notification with colors
"""
from colorama import Fore, Back, Style
if event['type'] in ['info', 'debug']:
print Fore.GREEN + event['message'] + Fore.RESET
elif event['type'] == 'cc':
event['severity'] = event['severity'].title()
event['file'] = basename(event['file'])
print Fore.YELLOW + '[%(severity)s] %(file)s@%(line)s: %(message)s'% event + Fore.RESET
elif event['type'] == 'progress':
if not silent:
print '%s: %s' % (event['action'].title(), basename(event['file']))
def print_notify_verbose(event, silent=False): def print_notify_verbose(event, silent=False):
""" Default command line notification with more verbose mode """ Default command line notification with more verbose mode
""" """
@ -239,7 +221,7 @@ class mbedToolchain:
self.legacy_ignore_dirs = LEGACY_IGNORE_DIRS - set([target.name, LEGACY_TOOLCHAIN_NAMES[self.name]]) self.legacy_ignore_dirs = LEGACY_IGNORE_DIRS - set([target.name, LEGACY_TOOLCHAIN_NAMES[self.name]])
self.notify_fun = notify if notify is not None else print_notify_color self.notify_fun = notify if notify is not None else print_notify
self.options = options if options is not None else [] self.options = options if options is not None else []
self.macros = macros or [] self.macros = macros or []
@ -731,9 +713,6 @@ class mbedToolchain:
def var(self, key, value): def var(self, key, value):
self.notify({'type': 'var', 'key': key, 'val': value}) self.notify({'type': 'var', 'key': key, 'val': value})
from colorama import init
init()
from workspace_tools.settings import ARM_BIN from workspace_tools.settings import ARM_BIN
from workspace_tools.settings import GCC_ARM_PATH, GCC_CR_PATH, GCC_CS_PATH, CW_EWL_PATH, CW_GCC_PATH from workspace_tools.settings import GCC_ARM_PATH, GCC_CR_PATH, GCC_CS_PATH, CW_EWL_PATH, CW_GCC_PATH
from workspace_tools.settings import IAR_PATH from workspace_tools.settings import IAR_PATH