fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解
This commit is contained in:
@@ -163,7 +163,7 @@ class PluginManager:
|
||||
self._handlers = {}
|
||||
self._register_default_handlers()
|
||||
|
||||
def _register_default_handlers(self):
|
||||
def _register_default_handlers(self) -> None:
|
||||
"""注册默认处理器"""
|
||||
self._handlers[PluginType.CHROME_EXTENSION] = ChromeExtensionHandler(self)
|
||||
self._handlers[PluginType.FEISHU_BOT] = BotHandler(self, "feishu")
|
||||
@@ -371,7 +371,7 @@ class PluginManager:
|
||||
|
||||
return cursor.rowcount > 0
|
||||
|
||||
def record_plugin_usage(self, plugin_id: str):
|
||||
def record_plugin_usage(self, plugin_id: str) -> None:
|
||||
"""记录插件使用"""
|
||||
conn = self.db.get_conn()
|
||||
now = datetime.now().isoformat()
|
||||
@@ -826,9 +826,6 @@ class BotHandler:
|
||||
|
||||
async def _send_feishu_message(self, session: BotSession, message: str, msg_type: str) -> bool:
|
||||
"""发送飞书消息"""
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
timestamp = str(int(time.time()))
|
||||
|
||||
# 生成签名
|
||||
@@ -851,9 +848,6 @@ class BotHandler:
|
||||
|
||||
async def _send_dingtalk_message(self, session: BotSession, message: str, msg_type: str) -> bool:
|
||||
"""发送钉钉消息"""
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
timestamp = str(round(time.time() * 1000))
|
||||
|
||||
# 生成签名
|
||||
@@ -1358,7 +1352,7 @@ class WebDAVSyncManager:
|
||||
_plugin_manager = None
|
||||
|
||||
|
||||
def get_plugin_manager(db_manager=None):
|
||||
def get_plugin_manager(db_manager=None) -> None:
|
||||
"""获取 PluginManager 单例"""
|
||||
global _plugin_manager
|
||||
if _plugin_manager is None:
|
||||
|
||||
Reference in New Issue
Block a user