MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / SrcRemove

Function SrcRemove

tools/building.py:954–995  ·  view source on GitHub ↗
(src, remove)

Source from the content-addressed store, hash-verified

952 exit(0)
953
954def SrcRemove(src, remove):
955 if not src:
956 return
957
958 src_bak = src[:]
959
960 if type(remove) == type('str'):
961 if os.path.isabs(remove):
962 remove = os.path.relpath(remove, GetCurrentDir())
963 remove = os.path.normpath(remove)
964
965 for item in src_bak:
966 if type(item) == type('str'):
967 item_str = item
968 else:
969 item_str = item.rstr()
970
971 if os.path.isabs(item_str):
972 item_str = os.path.relpath(item_str, GetCurrentDir())
973 item_str = os.path.normpath(item_str)
974
975 if item_str == remove:
976 src.remove(item)
977 else:
978 for remove_item in remove:
979 remove_str = str(remove_item)
980 if os.path.isabs(remove_str):
981 remove_str = os.path.relpath(remove_str, GetCurrentDir())
982 remove_str = os.path.normpath(remove_str)
983
984 for item in src_bak:
985 if type(item) == type('str'):
986 item_str = item
987 else:
988 item_str = item.rstr()
989
990 if os.path.isabs(item_str):
991 item_str = os.path.relpath(item_str, GetCurrentDir())
992 item_str = os.path.normpath(item_str)
993
994 if item_str == remove_str:
995 src.remove(item)
996
997def GetVersion():
998 import SCons.cpp

Callers

nothing calls this directly

Calls 1

GetCurrentDirFunction · 0.70

Tested by

no test coverage detected