From 6b38c58750a2a7d06d0b4c1003502fa96cad0b5a Mon Sep 17 00:00:00 2001 From: 9700X_PC <9700X_PC@gmail.com> Date: Wed, 13 Nov 2024 16:55:51 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EC=99=80=20=ED=95=A8=EA=BB=98=20browser=5Fcontroller=EC=97=90?= =?UTF-8?q?=20=EC=A0=84=EB=8B=AC=EB=90=9C=20toggle=5Fstate=20=EB=94=95?= =?UTF-8?q?=EC=85=94=EB=84=88=EB=A6=AC=EC=9D=98=20=EC=9E=AC=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser_control.py | 24 +++++++++++++----------- gui.py | 7 ------- option.py | 5 ++++- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/browser_control.py b/browser_control.py index 9621bfc3..740bef79 100644 --- a/browser_control.py +++ b/browser_control.py @@ -1054,6 +1054,8 @@ class BrowserController(QThread): items_per_page = result.get("items_per_page", 0) self.logger.debug(f"총 상품 수: {total_products}, 페이지당 상품 수: {items_per_page}") + self.logger.debug(f"[ self.toggle_states 상태 ]\n{self.toggle_states}") + if total_products == 0: self.logger.debug('수집할 상품이 없습니다. 작업을 종료합니다.') return @@ -1112,41 +1114,41 @@ class BrowserController(QThread): product_category = await self.titleHandler.get_category(market='ss') # 카테고리 가져오기 # 옵션 수정 - is_optionTrnas = self.toggle_states.get('optionTrnas', False) - is_optionIMGTrans = self.toggle_states.get('optionIMGTrans', False) - is_optionAutoSelect = self.toggle_states.get('optionAutoSelect', False) + is_optionTrnas = self.toggle_states.get('optionTrnas') + is_optionIMGTrans = self.toggle_states.get('optionIMGTrans') + is_optionAutoSelect = self.toggle_states.get('optionAutoSelect') if is_optionTrnas or is_optionIMGTrans or is_optionAutoSelect: - self.logger.debug(f"옵션수정 : optionTrnas={is_optionTrnas} + optionIMGTrans={is_optionIMGTrans} + optionAutoSelect{is_optionAutoSelect}") + self.logger.debug(f"옵션수정 : optionTrnas={is_optionTrnas} + optionIMGTrans={is_optionIMGTrans} + optionAutoSelect={is_optionAutoSelect}") await self.edit_option(product_name) # 가격 수정 - is_price = self.toggle_states.get('price', False) + is_price = self.toggle_states.get('price') if is_price: self.logger.debug(f"가격수정 : {is_price} ") await self.edit_price(product_category) # 썸네일 수정 - thumb = self.toggle_states.get('thumb',False) + thumb = self.toggle_states.get('thumb') if thumb: self.logger.debug(f"썸네일수정 : {thumb} ") await self.edit_thumb() # 태그 수정 - if self.toggle_states.get('tag',False): + if self.toggle_states.get('tag'): pass # 상품명 수정 - if self.toggle_states.get('title',False): + if self.toggle_states.get('title'): pass # 상세페이지 수정 - detail_Option = self.toggle_states.get('detail_Option',False) - detail_IMGTrans = self.toggle_states.get('detail_IMGTrans',False) + detail_Option = self.toggle_states.get('detail_Option') + detail_IMGTrans = self.toggle_states.get('detail_IMGTrans') if detail_Option or detail_IMGTrans: self.logger.debug(f"상세페이지 수정 : {detail_Option} + {detail_IMGTrans}") - if not self.toggle_states.get('recovery_mode',False): + if not self.toggle_states.get('recovery_mode'): await self.detail_trans() else: await self.detail_trans_for_recovery(product_name, deleted_imgs) diff --git a/gui.py b/gui.py index 79e3fc26..4c5b17d2 100644 --- a/gui.py +++ b/gui.py @@ -751,13 +751,6 @@ class AutoPercentyGUI(QWidget): # self.browser_controller.start() # QThread의 start() 호출로 run() 실행 self.logger.debug("브라우저 스레드가 시작되었습니다.") - # GUI 상태와 로그인 정보 가져오기 - self.browser_controller.toggle_states = { - 'optionIMGTrans': self.toggle_states['optionIMGTrans'], - 'detail_IMGTrans': self.toggle_states['detail_IMGTrans'], - 'thumb': self.toggle_states['thumb'], - 'vd_mode': self.toggle_states['vd_mode'], - } self.browser_controller.login_infos = { 'admin_id': self.admin_id_input.text(), 'admin_pw': self.admin_pw_input.text(), diff --git a/option.py b/option.py index 8da982a4..8f050562 100644 --- a/option.py +++ b/option.py @@ -212,6 +212,8 @@ class OptionHandler: # 3. 가격 낮은 순 정렬 클릭 await self.low_order_click() + + # 4. 옵션 정보 수집 try: self.logger.info(f"옵션 정보 수집") self.option_info = await self.collect_options_info() @@ -220,9 +222,10 @@ class OptionHandler: # 옵션 처리 중 오류 발생 시 전체 로그 출력 self.logger.error(f"옵션 정보 수집 중 오류 발생: {e}", exc_info=True) - # 4. 옵션 정보 수집 및 번역 + # 5. 옵션 번역 optionTrnas = toggle_states.get('optionTrnas') + self.logger.debug(f"optionTrnas : {optionTrnas}") if optionTrnas: self.logger.debug(f"옵션 AI번역 : {optionTrnas}")