-
Notifications
You must be signed in to change notification settings - Fork 16
/
update.py
25 lines (20 loc) · 856 Bytes
/
update.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
import os
from pathlib import Path
import shutil
import os.path
def update_text_resource(source_dir, dest_dir):
dirs = os.listdir(dest_dir)
string_file_name = "strings.xml"
for dir_name in dirs:
if dir_name.startswith("value"):
source_path = source_dir + os.sep + dir_name + os.sep + string_file_name
dest_path = dest_dir + os.sep + dir_name + os.sep + string_file_name
source_file = Path(source_path)
if source_file.exists():
print("try to copy [" + source_path + " to [" + dest_path + "]")
shutil.copy(source_path, dest_path)
# def updateValueDir(sourceDir, destDir):
#
if __name__ == "__main__":
update_text_resource("C:\\Develop\\work\\gitlab\\LifeUp-Private\\app\\src\\main\\res"
, "C:\\Develop\\LifeUp-Translation")