add function into gen_func

This commit is contained in:
Yam ZhengLim
2022-09-26 19:42:02 +08:00
parent 7d60227b89
commit 13d7d0545e
2 changed files with 7 additions and 7 deletions
+6 -1
View File
@@ -20,4 +20,9 @@ def delete_csv_in_path(path):
path = os.path.join(folder, file)
print('deleted : ', path )
os.remove(path)
print("[Delete Temp Complete]",file)
print("[Delete Temp Complete]",file)
def change_to_current_directory():
script_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(script_dir)
+1 -6
View File
@@ -38,15 +38,10 @@ def exchange_load_to_cloudstorage(EXCHANGE_CSV_TEMP_STORAGE_PATH):
file_path = os.path.join(dirpath,file_name)
ex_load_func.upload_to_bucket(ex_storage_client, file_name, file_path)
def linux_change_cron_directory():
script_dir = os.path.dirname(os.path.realpath(__file__))
print (os.getcwd())
os.chdir(script_dir)
def main():
#Make sure cron in the file directory
linux_change_cron_directory()
general_function.change_to_current_directory()
#Extract Load Exchange Data, and delete the temp csv
EXCHANGE_CSV_TEMP_STORAGE_PATH = "./exchange/extract/exchange_temp_extract_csv/"