Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forbid adding platform that needs browser in no-browser env #609

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

felinae98
Copy link
Collaborator

fix #539

@felinae98 felinae98 added the bug Something isn't working label Aug 12, 2024
@felinae98 felinae98 requested a review from AzideCupric August 12, 2024 12:49
Copy link

netlify bot commented Aug 12, 2024

Deploy Preview for nonebot-bison ready!

Name Link
🔨 Latest commit 8cf0c3f
🔍 Latest deploy log https://app.netlify.com/sites/nonebot-bison/deploys/66cead48cbc9e80008453b33
😎 Deploy Preview https://deploy-preview-609--nonebot-bison.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.29%. Comparing base (32e3bcc) to head (8cf0c3f).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
nonebot_bison/platform/__init__.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #609   +/-   ##
=======================================
  Coverage   85.28%   85.29%           
=======================================
  Files          91       91           
  Lines        4777     4787   +10     
=======================================
+ Hits         4074     4083    +9     
- Misses        703      704    +1     
Flag Coverage Δ
smoke-test 85.29% <90.90%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -39,6 +40,8 @@ async def parse_platform(state: T_State, platform: str = ArgPlainText()) -> None
elif platform == "取消":
await add_sub.finish("已中止订阅")
elif platform in platform_manager:
if platform_manager[platform].site.require_browser and not plugin_config.bison_use_browser:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉提供一个platform_manager.active_platforms好一点

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样就不知道为什么某个 platform 添加不了咯

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个在注册阶段日志提醒一下就好吧,订阅的时候让他自己检查日志?不然这里看着也太丑了(
或者加一个inactive_platforms,记录[{"platform_name": "xxx", "reason": "xxx"}]?

@AzideCupric
Copy link
Collaborator

AzideCupric commented Aug 17, 2024

#543#607 感觉是可以一起实现的

@felinae98 felinae98 force-pushed the bug/forbid-add-sub branch 3 times, most recently from 6d38c94 to a84379f Compare August 18, 2024 14:58


# platform => reason for not available
unavailable_paltforms: dict[str, str] = _get_unavailable_platforms()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

话说为什么unavailable_paltforms不是platform_manager的方法

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform_manager 是个 dict

@AzideCupric AzideCupric self-requested a review August 29, 2024 15:42
@felinae98 felinae98 changed the title 🐛 forbid adding platform that needs browser in no-browser env forbid adding platform that needs browser in no-browser env Aug 30, 2024
@felinae98 felinae98 merged commit 60e6f05 into main Aug 30, 2024
24 checks passed
@felinae98 felinae98 deleted the bug/forbid-add-sub branch August 30, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

新版本提示AttributeError: ("'NoneType' object has no attribute 'get_live_action'", [])
3 participants