You've already forked Douyin_Web_Live
架构修改,删除Edge浏览器支持,配置可以自己保存
This commit is contained in:
1
common/__init__.py
Normal file
1
common/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .singleton import Singleton
|
1
common/items/__init__.py
Normal file
1
common/items/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .tab_info import TabInfo
|
14
common/items/tab_info.py
Normal file
14
common/items/tab_info.py
Normal file
@ -0,0 +1,14 @@
|
||||
class TabInfo(object):
|
||||
TAB_TYPE_OTHER = "other"
|
||||
TAB_TYPE_USER = "user"
|
||||
TAB_TYPE_LIVE = "live"
|
||||
|
||||
def __init__(self):
|
||||
self.tab_handler: str = ""
|
||||
"""WebDriver中,该标签的句柄ID"""
|
||||
self.url: str = ""
|
||||
"""标签地址"""
|
||||
self.tab_type: str = self.TAB_TYPE_OTHER
|
||||
"""标签类型,展示用"""
|
||||
self.tab_keep: bool = False
|
||||
"""关闭标签时,避免被误关"""
|
10
common/singleton.py
Normal file
10
common/singleton.py
Normal file
@ -0,0 +1,10 @@
|
||||
class Singleton(type):
|
||||
"""
|
||||
单例模式(以metaclass方式实现)
|
||||
"""
|
||||
_instances = {}
|
||||
|
||||
def __call__(cls, *args, **kwargs):
|
||||
if cls not in cls._instances:
|
||||
cls._instances[cls] = super().__call__(*args, **kwargs)
|
||||
return cls._instances[cls]
|
Reference in New Issue
Block a user