Move filter dot into exporter base class

pull/6487/head
Jimmy Brisson 2018-03-27 14:26:15 -05:00
parent 062164eaad
commit b60729d147
2 changed files with 14 additions and 15 deletions

View File

@ -259,6 +259,20 @@ class Exporter(object):
def all_supported_targets(cls):
return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]
@staticmethod
def filter_dot(str):
"""
Remove the './' or '.\\' prefix, if present.
"""
if str == None:
return None
if str[:2] == './':
return str[2:]
if str[:2] == '.\\':
return str[2:]
return str
def apply_supported_whitelist(compiler, whitelist, target):
"""Generate a list of supported targets for a given compiler and post-binary hook

View File

@ -417,21 +417,6 @@ class GNUARMEclipse(Exporter):
# -------------------------------------------------------------------------
@staticmethod
def filter_dot(str):
"""
Remove the './' prefix, if present.
This function assumes that resources.win_to_unix()
replaced all windows backslashes with slashes.
"""
if str == None:
return None
if str[:2] == './':
return str[2:]
return str
# -------------------------------------------------------------------------
def dump_tree(self, nodes, depth=0):
for k in nodes.keys():
node = nodes[k]