(text:str)
| 147 | |
| 148 | |
| 149 | def 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)) |