File: sort_all.py

package info (click to toggle)
opencc 1.1.1%2Bgit20200624%2Bds2-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,288 kB
  • sloc: cpp: 5,688; python: 348; javascript: 133; makefile: 101; sh: 58
file content (17 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
import sys

from common import sort_items

if len(sys.argv) < 2:
    print("Sort the dictionary")
    print(("Usage: ", sys.argv[0], "[directory]"))
    exit(1)

dirtectory = sys.argv[1]
files = glob.glob(dirtectory + "/*")
for filename in files:
    print(filename)
    sort_items(filename, filename)