From b1b36ff6b3ec1817641b264890752d16b38cd847 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Fri, 5 Nov 2021 20:56:12 +0700 Subject: [PATCH 1/2] build_make custom extension and default is txt --- build_make.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_make.py b/build_make.py index 79aa6df..814d32f 100644 --- a/build_make.py +++ b/build_make.py @@ -2,12 +2,12 @@ import os import glob import shutil -def filepath_mass_changer(Version ,path ,apapath): +def filepath_mass_changer(Version ,path ,apapath, extension="txt"): f = glob.glob(os.path.join(path,"*.txt")) for filename in f: s = os.path.basename(filename) os.rename(filename, os.path.join(path, Version + '_' + s )) - f = glob.glob(os.path.join(path,"*.txt")) + f = glob.glob(os.path.join(path,"*."+extension)) for filename in f: s = os.path.basename(filename) shutil.copy2(os.path.join(path,s), apapath) \ No newline at end of file From 1f349a5cb7a5836d1527e797f4a6b2abf2111d61 Mon Sep 17 00:00:00 2001 From: Minoplhy Date: Fri, 5 Nov 2021 22:03:04 +0700 Subject: [PATCH 2/2] fix path not changes --- build_make.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_make.py b/build_make.py index 814d32f..6ffc99f 100644 --- a/build_make.py +++ b/build_make.py @@ -3,11 +3,11 @@ import glob import shutil def filepath_mass_changer(Version ,path ,apapath, extension="txt"): - f = glob.glob(os.path.join(path,"*.txt")) + f = glob.glob(os.path.join(path,"*."+extension)) for filename in f: s = os.path.basename(filename) os.rename(filename, os.path.join(path, Version + '_' + s )) f = glob.glob(os.path.join(path,"*."+extension)) for filename in f: s = os.path.basename(filename) - shutil.copy2(os.path.join(path,s), apapath) \ No newline at end of file + shutil.copy2(os.path.join(path,s), apapath)