Skip to content

Commit d229fe0

Browse files
committed
Futurize stage 2 mbed-os-tools
1 parent 9f75cb1 commit d229fe0

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

src/mbed_os_tools/detect/lstools_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
LOCAL_PLATFORM_DATABASE,
2929
LOCAL_MOCKS_DATABASE,
3030
)
31+
from future.utils import with_metaclass
3132

3233
mbedls_root_logger = logging.getLogger("mbedls")
3334
mbedls_root_logger.setLevel(logging.WARNING)
@@ -56,13 +57,11 @@ class FSInteraction(object):
5657
Never = 3
5758

5859

59-
class MbedLsToolsBase(object):
60+
class MbedLsToolsBase(with_metaclass(ABCMeta, object)):
6061
""" Base class for mbed-lstools, defines mbed-ls tools interface for
6162
mbed-enabled devices detection for various hosts
6263
"""
6364

64-
__metaclass__ = ABCMeta
65-
6665
# Which OSs are supported by this module
6766
# Note: more than one OS can be supported by mbed-lstools_* module
6867
os_supported = []

src/mbed_os_tools/test/mbed_greentea_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"""
2525

2626

27-
class GreenteaTestHook():
27+
class GreenteaTestHook(object):
2828
"""! Class used to define
2929
"""
3030
name = None
@@ -204,7 +204,7 @@ def check_if_file_exists_or_is_empty(expr):
204204
result = result.replace('>>', '')
205205
return result
206206

207-
class GreenteaHooks():
207+
class GreenteaHooks(object):
208208
"""! Class used to store all hooks
209209
@details Hooks command starts with '$' dollar sign
210210
"""

src/mbed_os_tools/test/mbed_greentea_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
COLORAMA = False
2323

2424

25-
class GreenTeaSimpleLockLogger:
25+
class GreenTeaSimpleLockLogger(object):
2626
"""! Simple locking printing mechanism
2727
@details We are using parallel testing
2828
"""

src/mbed_os_tools/test/mbed_yotta_module_parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import json
1818

1919

20-
class YottaConfig():
20+
class YottaConfig(object):
2121

2222
yotta_config = None
2323

@@ -75,7 +75,7 @@ def get_test_pins(self):
7575
return None
7676

7777

78-
class YottaModule():
78+
class YottaModule(object):
7979

8080
__yotta_module = None
8181
__greentea_client = 'greentea-client'

src/mbed_os_tools/test/tests_spec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import json
2323

2424

25-
class TestBinary:
25+
class TestBinary(object):
2626
"""
2727
Class representing a Test Binary.
2828
"""
@@ -66,7 +66,7 @@ def get_compare_log(self):
6666
return self.__comp_log
6767

6868

69-
class Test:
69+
class Test(object):
7070
"""
7171
class representing a Test artifact that may contain more than one test binaries.
7272
"""
@@ -136,7 +136,7 @@ def add_binary(self, path, binary_type, compare_log=None):
136136
compare_log)
137137

138138

139-
class TestBuild:
139+
class TestBuild(object):
140140
"""
141141
class for Test build.
142142
"""
@@ -245,7 +245,7 @@ def add_test(self, name, test):
245245
self.__tests[name] = test
246246

247247

248-
class TestSpec:
248+
class TestSpec(object):
249249
"""
250250
Test specification. Contains Builds.
251251
"""

0 commit comments

Comments
 (0)