Skip to content

mbedToolchain class simple cleanup #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions workspace_tools/toolchains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
from os import stat, walk, remove
from os import stat, walk
from os.path import join, splitext, exists, relpath, dirname, basename, split
from shutil import copyfile
from copy import copy
Expand All @@ -23,12 +23,10 @@
from time import time

from workspace_tools.utils import run_cmd, mkdir, rel_path, ToolException, split_path
from workspace_tools.patch import patch
from workspace_tools.settings import BUILD_OPTIONS, MBED_ORG_USER

from multiprocessing import Pool, Manager, cpu_count
from multiprocessing import Pool, cpu_count
from time import sleep
from pprint import pprint

import workspace_tools.hooks as hooks
import re
Expand Down Expand Up @@ -58,7 +56,7 @@ def print_notify_verbose(event):
elif event['type'] == 'cc':
event['severity'] = event['severity'].title()
event['file'] = basename(event['file'])
event['mcu_name'] = "None"
event['mcu_name'] = "None"
event['toolchain'] = "None"
event['target_name'] = event['target_name'].upper() if event['target_name'] else "Unknown"
event['toolchain_name'] = event['toolchain_name'].upper() if event['toolchain_name'] else "Unknown"
Expand Down Expand Up @@ -153,7 +151,7 @@ def win_to_unix(self):
self.linker_script = self.linker_script.replace('\\', '/')

def __str__(self):
s = []
s = []

for (label, resources) in (
('Include Directories', self.inc_dirs),
Expand Down Expand Up @@ -242,7 +240,7 @@ def __init__(self, target, options=None, notify=None, macros=None):

self.mp_pool = None

def __exit__():
def __exit__(self):
if self.mp_pool is not None:
self.mp_pool.terminate()

Expand Down Expand Up @@ -366,7 +364,7 @@ def scan_resources(self, path):
elif ext == '.o':
resources.objects.append(file_path)

elif ext == self.LIBRARY_EXT:
elif ext == self.LIBRARY_EXT:
resources.libraries.append(file_path)
resources.lib_dirs.add(root)

Expand Down Expand Up @@ -443,9 +441,9 @@ def compile_sources(self, resources, build_path, inc_dirs=None):
if inc_dirs is not None:
inc_paths.extend(inc_dirs)

objects=[]
queue=[]
prev_dir=None
objects = []
queue = []
prev_dir = None

# The dependency checking for C/C++ is delegated to the compiler
base_path = resources.base_path
Expand Down Expand Up @@ -692,7 +690,8 @@ def var(self, key, value):


from workspace_tools.toolchains.arm import ARM_STD, ARM_MICRO
from workspace_tools.toolchains.gcc import GCC_ARM, GCC_CS, GCC_CR, GCC_CW_EWL, GCC_CW_NEWLIB
from workspace_tools.toolchains.gcc import GCC_ARM, GCC_CS, GCC_CR
from workspace_tools.toolchains.gcc import GCC_CW_EWL, GCC_CW_NEWLIB
from workspace_tools.toolchains.iar import IAR

TOOLCHAIN_CLASSES = {
Expand Down