From ad9a74903d8f1e77346304cc67d68d5667bad65f Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 29 Aug 2023 10:23:08 +0900 Subject: [PATCH] =?UTF-8?q?update.=20warning=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pydork/engine.py | 19 ++++++++++--------- pydork/engine_common.py | 16 +++++++--------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/pydork/engine.py b/pydork/engine.py index 635adbf..a65fbf5 100644 --- a/pydork/engine.py +++ b/pydork/engine.py @@ -369,8 +369,8 @@ def search(self, keyword: str, search_type='text', maximum=100): self.ENGINE.MESSAGE.print_text( url, mode='debug', - separator=": ", - header=self.ENGINE.MESSAGE.HEADER + ': ' + + separator=": ", # type: ignore + header=self.ENGINE.MESSAGE.HEADER + ': ' + \ Color.GRAY + '[DEBUG]: [TargetURL]' + Color.END ) @@ -378,8 +378,8 @@ def search(self, keyword: str, search_type='text', maximum=100): self.ENGINE.MESSAGE.print_text( self.ENGINE.USER_AGENT, mode='debug', - separator=": ", - header=self.ENGINE.MESSAGE.HEADER + ': ' + + separator=": ", # type: ignore + header=self.ENGINE.MESSAGE.HEADER + ': ' + \ Color.GRAY + '[DEBUG]: [UserAgent]' + Color.END ) @@ -391,8 +391,8 @@ def search(self, keyword: str, search_type='text', maximum=100): self.ENGINE.MESSAGE.print_text( html, mode='debug', - separator=": ", - header=self.ENGINE.MESSAGE.HEADER + ': ' + + separator=": ", # type: ignore + header=self.ENGINE.MESSAGE.HEADER + ': ' + \ Color.GRAY + '[DEBUG]: [Response]' + Color.END ) @@ -425,8 +425,8 @@ def search(self, keyword: str, search_type='text', maximum=100): # debug self.ENGINE.MESSAGE.print_text( html, - mode='debug', - header=self.ENGINE.MESSAGE.HEADER + ': ' + Color.GRAY + + mode='debug', # type: ignore + header=self.ENGINE.MESSAGE.HEADER + ': ' + Color.GRAY + \ '[DEBUG]: [ReCaptchaedResponse]' + Color.END, separator=": " ) @@ -495,7 +495,8 @@ def search(self, keyword: str, search_type='text', maximum=100): # commandの場合の出力処理 self.ENGINE.MESSAGE.print_text( - 'Finally got ' + self.ENGINE.COLOR + + # type: ignore + 'Finally got ' + self.ENGINE.COLOR + \ str(len(result)) + Color.END + ' links.', header=self.ENGINE.MESSAGE.ENGINE, separator=": ", diff --git a/pydork/engine_common.py b/pydork/engine_common.py index 7b649df..e3712cc 100644 --- a/pydork/engine_common.py +++ b/pydork/engine_common.py @@ -10,8 +10,6 @@ * SearchEngine Classから呼び出す、各検索エンジンで共通の処理を保持させる継承用Classである `CommonEngine` を持つモジュール. """ -import sys - import requests import os import pickle @@ -644,7 +642,7 @@ def get_links(self, source_url, html: str, type: str): # before processing elists self.MESSAGE.print_text( ','.join(elinks), # type: ignore - header=self.MESSAGE.HEADER + ': ' + Color.BLUE + + header=self.MESSAGE.HEADER + ': ' + Color.BLUE + \ '[BeforeProcessing elinks]' + Color.END, separator=" :", mode="debug", @@ -652,9 +650,9 @@ def get_links(self, source_url, html: str, type: str): # before processing etitles self.MESSAGE.print_text( - ','.join(etitles), - header=self.MESSAGE.HEADER + ': ' + - Color.BLUE + '[BeforeProcessing etitles]' + Color.END, + ','.join(etitles), # type: ignore + header=self.MESSAGE.HEADER + ': ' + Color.BLUE + \ + '[BeforeProcessing etitles]' + Color.END, separator=" :", mode="debug", ) @@ -666,7 +664,7 @@ def get_links(self, source_url, html: str, type: str): # after processing elists self.MESSAGE.print_text( ','.join(elinks), # type: ignore - header=self.MESSAGE.HEADER + ': ' + + header=self.MESSAGE.HEADER + ': ' + \ Color.GREEN + '[AfterProcessing elinks]' + Color.END, separator=" :", mode="debug", @@ -674,8 +672,8 @@ def get_links(self, source_url, html: str, type: str): # after processing etitles self.MESSAGE.print_text( - ','.join(etitles), - header=self.MESSAGE.HEADER + ': ' + + ','.join(etitles), # type: ignore + header=self.MESSAGE.HEADER + ': ' + \ Color.GREEN + '[AfterProcessing etitles]' + Color.END, separator=" :", mode="debug",