Add warning for deprecating replaychat

This commit is contained in:
taizan-hokuto
2020-01-03 23:45:08 +09:00
parent 9c41536533
commit a1e48b56e6
2 changed files with 34 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import signal
import time import time
import traceback import traceback
import urllib.parse import urllib.parse
import warnings
from aiohttp.client_exceptions import ClientConnectorError from aiohttp.client_exceptions import ClientConnectorError
from concurrent.futures import CancelledError from concurrent.futures import CancelledError
from asyncio import Queue from asyncio import Queue
@@ -25,7 +26,15 @@ MAX_RETRY = 10
class ReplayChatAsync: class ReplayChatAsync:
'''asyncio(aiohttp)を利用してYouTubeのチャットデータを取得する。 '''
### -----------------------------------------------------------
### [Warning] ReplayChatAsync is integrated into LiveChatAsync.
### This class is deprecated and will be removed at v0.0.5.0.
### ReplayChatAsyncはLiveChatAsyncに統合しました。
### このクラスはv0.0.5.0で廃止予定です。
### -----------------------------------------------------------
asyncio(aiohttp)を利用してYouTubeのチャットデータを取得する。
Parameter Parameter
--------- ---------
@@ -77,6 +86,12 @@ class ReplayChatAsync:
done_callback = None, done_callback = None,
exception_handler = None, exception_handler = None,
direct_mode = False): direct_mode = False):
warnings.warn(""
f"\n{'-'*60}\n[WARNING] ReplayChatAsync is integrated "
f"into LiveChatAsync.\n{' '*5} This is deprecated and will"
f" be removed at v0.0.5.0.\n{'-'*60}\n"
)
self.video_id = video_id self.video_id = video_id
self.seektime = seektime self.seektime = seektime
if isinstance(processor, tuple): if isinstance(processor, tuple):

View File

@@ -6,6 +6,7 @@ import signal
import time import time
import traceback import traceback
import urllib.parse import urllib.parse
import warnings
from concurrent.futures import CancelledError, ThreadPoolExecutor from concurrent.futures import CancelledError, ThreadPoolExecutor
from queue import Queue from queue import Queue
from .buffer import Buffer from .buffer import Buffer
@@ -22,7 +23,15 @@ MAX_RETRY = 10
class ReplayChat: class ReplayChat:
''' スレッドプールを利用してYouTubeのライブ配信のチャットデータを取得する '''
### -----------------------------------------------------------
### [Warning] ReplayChat is integrated into LiveChat.
### This class is deprecated and will be removed at v0.0.5.0.
### ReplayChatはLiveChatに統合しました。
### このクラスはv0.0.5.0で廃止予定です。
### -----------------------------------------------------------
スレッドプールを利用してYouTubeのライブ配信のチャットデータを取得する
Parameter Parameter
--------- ---------
@@ -64,8 +73,10 @@ class ReplayChat:
''' '''
_setup_finished = False _setup_finished = False
#チャット監視中のListenerのリスト #チャット監視中のListenerのリスト
_listeners= [] _listeners= []
def __init__(self, video_id, def __init__(self, video_id,
seektime = 0, seektime = 0,
processor = DefaultProcessor(), processor = DefaultProcessor(),
@@ -75,6 +86,12 @@ class ReplayChat:
done_callback = None, done_callback = None,
direct_mode = False direct_mode = False
): ):
warnings.warn(""
f"\n{'-'*60}\n[WARNING] ReplayChat is integrated into LiveChat.\n"
f"{' '*5}This is deprecated and will be removed at v0.0.5.0.\n"
f"{'-'*60}\n"
)
self.video_id = video_id self.video_id = video_id
self.seektime = seektime self.seektime = seektime
if isinstance(processor, tuple): if isinstance(processor, tuple):