mirror of
https://gitlab.com/cief-data/data-management.git
synced 2026-08-19 04:13:57 +00:00
add function into gen_func
This commit is contained in:
+6
-1
@@ -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)
|
||||
@@ -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/"
|
||||
|
||||
Reference in New Issue
Block a user