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

Method sort

tools/mkromfs.py:101–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

99 self._children.append(File(ent))
100
101 def sort(self):
102 def _sort(x, y):
103 if x.name == y.name:
104 return 0
105 elif x.name > y.name:
106 return 1
107 else:
108 return -1
109 from functools import cmp_to_key
110 self._children.sort(key=cmp_to_key(_sort))
111
112 # sort recursively
113 for c in self._children:
114 if isinstance(c, Folder):
115 c.sort()
116
117 def dump(self, indent=0):
118 print('%s%s' % (' ' * indent, self._name))

Callers 14

MergeGroupFunction · 0.80
TargetGetListFunction · 0.80
ProjectInfoFunction · 0.80
print_all_fxnsFunction · 0.80
mkromfs.pyFile · 0.80
CLAddHeaderFilesFunction · 0.80
TargetCodeliteFunction · 0.80
VS_AddHeadFilesGroupFunction · 0.80
VSProjectFunction · 0.80
CB_AddHeadFilesFunction · 0.80
CBProjectFunction · 0.80
VS_add_HeadFilesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected