MCPcopy Create free account
hub / github.com/chasingboy/Xtools / format_dirsx_result

Function format_dirsx_result

lib/format_tools_result.py:149–164  ·  view source on GitHub ↗
(text:str)

Source from the content-addressed store, hash-verified

147
148
149def format_dirsx_result(text:str) -> str:
150 texts, results = text.split('\n'), []
151
152 for text in texts:
153 try:
154 assert text.startswith('[RET]')
155 _, code, end = text.split(' ', 2)
156 except:
157 continue
158
159 results.append('{code} {end}'.format(code=code, end=end))
160
161 if results == []:
162 return '[waring-dirsx] The result format is not supported! Please read the docs'
163
164 return '\n'.join(sorted(results))

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected