-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck_done_convert.py
More file actions
executable file
·48 lines (36 loc) · 1.03 KB
/
check_done_convert.py
File metadata and controls
executable file
·48 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
#encoding=utf-8
import os
from os.path import join, exists
import glob
import TtfConfig
# to copy/move file.
import shutil
def convert(path, config):
idx=0
convert_count=0
filename_pattern = path + "/*.glyph"
for name in glob.glob(filename_pattern):
idx+=1
print(idx,":convert filename:", name)
source_path = name
target_path = join("../undo",name)
shutil.copy(source_path,target_path)
if idx >= 100:
break
return idx
def scan_folders(target_path):
#path="."
print("Checking path:", target_path)
file_count = 0
file_count = convert(target_path, TtfConfig.TtfConfig())
print("Finish!\ncheck file count:%d\n" % (file_count))
if __name__ == '__main__':
import sys
argument_count = 2
if len(sys.argv)==argument_count:
target_path = sys.argv[1]
scan_folders(target_path)
else:
print("Argument must be: %d" % (argument_count -1))
print("Ex:%s project.sfdir" % (sys.argv[0]))