
from base_class import BaseVariableFunction
from base_class import *
baseclass = BaseVariableFunction(__file__)


old_print = print


def timestamped_print(*args, **kwargs):
    old_print(datetime.datetime.utcnow().replace(
        microsecond=0), *args, **kwargs)


print = timestamped_print
print('\n'*5)
print(f"{'{:<6}'.format('ENTER')} {baseclass.scriptfilename} ----------------NOTE-----------NOTE---------------")


def filter_onhand_dalao():

    filter_dalao_df = pd.read_excel(baseclass.dalao_merge_path /
                       "filter_dalao.xlsx", dtype=object)
    arr_new_filter_dalao = []
    
    for index, row in filter_dalao_df.iterrows():
        arr_cur_dalao = row.dropna().tolist()
        arr_new_filter_dalao.extend(arr_cur_dalao)

    # print(arr_new_filter_dalao)
 
    df = pd.DataFrame(arr_new_filter_dalao, columns=["dalaoAddress"])
    
 
    df.to_csv(baseclass.dalao_merge_path /
              "filter_dalao.csv", index=False)
    

    return


filter_onhand_dalao()


print(f"{'{:<6}'.format('END')} {baseclass.scriptfilename} ----------------NOTE-----------NOTE---------------")
