-
Notifications
You must be signed in to change notification settings - Fork 3
/
sort_Hangul_Rime_Files.py
44 lines (30 loc) · 1.86 KB
/
sort_Hangul_Rime_Files.py
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
import os
import shutil
import time
#※新增資料夾(多層目錄, 如前一層data資料夾不存在, 將自動新增)※
os.makedirs('./sort_hangul_rime_files/', exist_ok=True)
os.makedirs('./sort_hangul_rime_files/other/', exist_ok=True)
#複製檔案(Hangul_2set)
shutil.copytree("./Hangul_2set/", "./sort_hangul_rime_files/Hangul_2set")
shutil.copyfile("./essay-kr-hanja.txt", "./sort_hangul_rime_files/Hangul_2set/essay-kr-hanja.txt")
shutil.copytree("./lua/", "./sort_hangul_rime_files/Hangul_2set/lua")
shutil.copyfile("./rime.lua", "./sort_hangul_rime_files/Hangul_2set/rime.lua")
#複製檔案(Hangul_HNC)
shutil.copytree("./Hangul_HNC/", "./sort_hangul_rime_files/Hangul_HNC")
shutil.copyfile("./essay-kr-hanja.txt", "./sort_hangul_rime_files/Hangul_HNC/essay-kr-hanja.txt")
shutil.copytree("./lua/", "./sort_hangul_rime_files/Hangul_HNC/lua")
shutil.copyfile("./rime.lua", "./sort_hangul_rime_files/Hangul_HNC/rime.lua")
#複製檔案(Hangul_Onion_Structure)
shutil.copytree("./Hangul_Onion_Structure/", "./sort_hangul_rime_files/Hangul_Onion_Structure")
shutil.copyfile("./essay-kr-hanja.txt", "./sort_hangul_rime_files/Hangul_Onion_Structure/essay-kr-hanja.txt")
#其他(other)
shutil.copytree('./cin/', './sort_hangul_rime_files/other/cin')
shutil.copytree('./trime/', './sort_hangul_rime_files/other/trime')
#複製說明文件
shutil.copyfile("./README.md", "./sort_hangul_rime_files/README.md")
#增加日期
localtime=time.strftime("%Y%m%d", time.localtime())
os.rename('./sort_hangul_rime_files/Hangul_2set/', './sort_hangul_rime_files/Hangul_2set-'+localtime)
os.rename('./sort_hangul_rime_files/Hangul_HNC/', './sort_hangul_rime_files/Hangul_HNC-'+localtime)
os.rename('./sort_hangul_rime_files/Hangul_Onion_Structure/', './sort_hangul_rime_files/Hangul_Onion_Structure-'+localtime)
os.rename('./sort_hangul_rime_files/', './電腦RIME韓文方案-'+localtime)