Skip to content

Commit d96e6ca

Browse files
committed
Merge pull request #446 from PrzemekWirkus/Toolchain-cleanup
mbedToolchain class simple cleanup
2 parents cc0476d + e5f2d11 commit d96e6ca

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

workspace_tools/toolchains/__init__.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
from os import stat, walk, remove
17+
from os import stat, walk
1818
from os.path import join, splitext, exists, relpath, dirname, basename, split
1919
from shutil import copyfile
2020
from copy import copy
@@ -23,12 +23,10 @@
2323
from time import time
2424

2525
from workspace_tools.utils import run_cmd, mkdir, rel_path, ToolException, split_path
26-
from workspace_tools.patch import patch
2726
from workspace_tools.settings import BUILD_OPTIONS, MBED_ORG_USER
2827

29-
from multiprocessing import Pool, Manager, cpu_count
28+
from multiprocessing import Pool, cpu_count
3029
from time import sleep
31-
from pprint import pprint
3230

3331
import workspace_tools.hooks as hooks
3432
import re
@@ -58,7 +56,7 @@ def print_notify_verbose(event):
5856
elif event['type'] == 'cc':
5957
event['severity'] = event['severity'].title()
6058
event['file'] = basename(event['file'])
61-
event['mcu_name'] = "None"
59+
event['mcu_name'] = "None"
6260
event['toolchain'] = "None"
6361
event['target_name'] = event['target_name'].upper() if event['target_name'] else "Unknown"
6462
event['toolchain_name'] = event['toolchain_name'].upper() if event['toolchain_name'] else "Unknown"
@@ -153,7 +151,7 @@ def win_to_unix(self):
153151
self.linker_script = self.linker_script.replace('\\', '/')
154152

155153
def __str__(self):
156-
s = []
154+
s = []
157155

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

243241
self.mp_pool = None
244242

245-
def __exit__():
243+
def __exit__(self):
246244
if self.mp_pool is not None:
247245
self.mp_pool.terminate()
248246

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

369-
elif ext == self.LIBRARY_EXT:
367+
elif ext == self.LIBRARY_EXT:
370368
resources.libraries.append(file_path)
371369
resources.lib_dirs.add(root)
372370

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

446-
objects=[]
447-
queue=[]
448-
prev_dir=None
444+
objects = []
445+
queue = []
446+
prev_dir = None
449447

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

693691

694692
from workspace_tools.toolchains.arm import ARM_STD, ARM_MICRO
695-
from workspace_tools.toolchains.gcc import GCC_ARM, GCC_CS, GCC_CR, GCC_CW_EWL, GCC_CW_NEWLIB
693+
from workspace_tools.toolchains.gcc import GCC_ARM, GCC_CS, GCC_CR
694+
from workspace_tools.toolchains.gcc import GCC_CW_EWL, GCC_CW_NEWLIB
696695
from workspace_tools.toolchains.iar import IAR
697696

698697
TOOLCHAIN_CLASSES = {

0 commit comments

Comments
 (0)