pos_update_gui.py > pos_update_daily_product.py 로 입력할 파일에 맞춰 파일명 변경
This commit is contained in:
@ -5,13 +5,13 @@ from watchdog.events import FileSystemEventHandler
|
||||
import threading
|
||||
|
||||
import pos_update_bill
|
||||
import pos_update_gui # 추가
|
||||
import pos_update_daily_product
|
||||
|
||||
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data'))
|
||||
|
||||
FILE_EXTENSIONS = ('.xls', '.xlsx')
|
||||
BILL_PREFIX = "영수증별매출상세현황"
|
||||
GUI_PREFIX = "일자별 (상품별)"
|
||||
DAILY_PRODUCT_PREFIX = "일자별 (상품별)"
|
||||
|
||||
class NewFileHandler(FileSystemEventHandler):
|
||||
def __init__(self):
|
||||
@ -28,7 +28,7 @@ class NewFileHandler(FileSystemEventHandler):
|
||||
return
|
||||
|
||||
# 처리 대상 여부 확인
|
||||
if filename.startswith(BILL_PREFIX) or filename.startswith(GUI_PREFIX):
|
||||
if filename.startswith(BILL_PREFIX) or filename.startswith(DAILY_PRODUCT_PREFIX):
|
||||
print(f"[WATCHER] 신규 파일 감지: {filename}")
|
||||
threading.Thread(target=self.process_file, args=(filepath, filename), daemon=True).start()
|
||||
|
||||
@ -45,8 +45,8 @@ class NewFileHandler(FileSystemEventHandler):
|
||||
print(f"[WATCHER] 파일 처리 시작: {filename}")
|
||||
if filename.startswith(BILL_PREFIX):
|
||||
pos_update_bill.main()
|
||||
elif filename.startswith(GUI_PREFIX):
|
||||
pos_update_gui.main()
|
||||
elif filename.startswith(DAILY_PRODUCT_PREFIX):
|
||||
pos_update_daily_product.main()
|
||||
else:
|
||||
print(f"[WATCHER] 처리 대상이 아님: {filename}")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user