29 lines
633 B
Python

from datetime import datetime
# 定数
LOG_LEVEL = {"d": 'Debug'}
MODE_TYPE = {
'n': 'normal',
'd': 'debug',
}
def debug_log(log, log_info, mode):
if MODE_TYPE['d'] == mode:
print(f'{datetime.now():%Y-%m-%d %H:%M:%S} {log_info} {LOG_LEVEL["d"]} {log}')
def convert_quotechar(quotechar):
"""csvモジュールの囲い文字を変換する
Args:
quotechar : 項目囲い文字の設定値
Returns:
空文字、空白文字の場合→None
それ以外→設定値をそのまま帰す
"""
if (quotechar.strip(' ') == ''):
return None
return quotechar