mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
style: introduce ruff as linter and formatter (#1356)
* style: remove necessary imports * style: fix F841 * style: fix F401 * style: fix F811 * style: fix E402 * style: fix E721 * style: fix E722 * style: fix E722 * style: fix F541 * style: ruff format * style: all passed * style: add ruff in deps * style: more ignores in ruff.toml * style: add pre-commit
This commit is contained in:
committed by
GitHub
parent
09e70d70e9
commit
209f16af76
@@ -9,39 +9,33 @@ class V2PluginDataAPI(apigroup.APIGroup):
|
||||
|
||||
def __init__(self, prefix: str, ap: app.Application):
|
||||
self.ap = ap
|
||||
super().__init__(prefix+"/plugin", ap)
|
||||
super().__init__(prefix + '/plugin', ap)
|
||||
|
||||
async def do(self, *args, **kwargs):
|
||||
if not self.ap.instance_config.data['telemetry']['report']:
|
||||
return None
|
||||
return await super().do(*args, **kwargs)
|
||||
|
||||
async def post_install_record(
|
||||
self,
|
||||
plugin: dict
|
||||
):
|
||||
async def post_install_record(self, plugin: dict):
|
||||
"""提交插件安装记录"""
|
||||
return await self.do(
|
||||
"POST",
|
||||
"/install",
|
||||
'POST',
|
||||
'/install',
|
||||
data={
|
||||
"basic": self.basic_info(),
|
||||
"plugin": plugin,
|
||||
}
|
||||
'basic': self.basic_info(),
|
||||
'plugin': plugin,
|
||||
},
|
||||
)
|
||||
|
||||
async def post_remove_record(
|
||||
self,
|
||||
plugin: dict
|
||||
):
|
||||
async def post_remove_record(self, plugin: dict):
|
||||
"""提交插件卸载记录"""
|
||||
return await self.do(
|
||||
"POST",
|
||||
"/remove",
|
||||
'POST',
|
||||
'/remove',
|
||||
data={
|
||||
"basic": self.basic_info(),
|
||||
"plugin": plugin,
|
||||
}
|
||||
'basic': self.basic_info(),
|
||||
'plugin': plugin,
|
||||
},
|
||||
)
|
||||
|
||||
async def post_update_record(
|
||||
@@ -52,14 +46,14 @@ class V2PluginDataAPI(apigroup.APIGroup):
|
||||
):
|
||||
"""提交插件更新记录"""
|
||||
return await self.do(
|
||||
"POST",
|
||||
"/update",
|
||||
'POST',
|
||||
'/update',
|
||||
data={
|
||||
"basic": self.basic_info(),
|
||||
"plugin": plugin,
|
||||
"update_info": {
|
||||
"old_version": old_version,
|
||||
"new_version": new_version,
|
||||
}
|
||||
}
|
||||
'basic': self.basic_info(),
|
||||
'plugin': plugin,
|
||||
'update_info': {
|
||||
'old_version': old_version,
|
||||
'new_version': new_version,
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user