Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
legnaleurc committed Dec 28, 2023
1 parent cc96617 commit 2c84080
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions drive/legacy/shell/sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/env python3

import json
import sys
import re


def main():
name_list: list[tuple[int, str]] = []
data: dict[str, str] = json.load(sys.stdin)

for _k, name in data.items():
m = re.search(r'\[(\d+)\]\.7z$', name)
if not m:
continue
eid = int(m.group(1))
name_list.append((eid, name))

name_list.sort(reverse=True)

for eid, name in name_list:
print(name)

return 0


if __name__ == "__main__":
sys.exit(main())

0 comments on commit 2c84080

Please sign in to comment.