-
Notifications
You must be signed in to change notification settings - Fork 37
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
CLI: Bedrock support and misc improvements #849
Conversation
simply measures the latency of status()
done in a slightly ad-hoc way, but this is the best we can do given the split of the response types.
Linting should be fixed. It would be nice to document how to run these checks (and/or the GH action could print the violations). (I did it by uncommitting my changes, then |
Yeah, https://mcstatus.readthedocs.io/en/stable/pages/contributing/ can be significantly improved |
Ah, I didn't even find that oops! I thought that would be end-user docs, and I was looking in the readme and CONTRIBUTING.md (which doesn't exist). I now see it is also in-repo at docs/pages/contributing.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice first PR, this is much better than my first
Is there a good server for testing query? demo.mcstatus.io seems to be failing. Edit: filed #857. |
I only use |
ValueError might be thrown by programming errors in json handling, for example.
since this runs both ping() then status(), it can report precisely when one fails and the other succeeds. some kludgy logic to switch bedrock too.
in anticipation of py-mine#536 Co-authored-by: Perchun Pak <[email protected]>
Or even better I think def run() -> None:
sys.exit(main(sys.argv[1:]))
if __name__ == "__main__":
run() |
i don't know if that's the best solution, considering that the so this would basically lead to the code of def run() -> None:
sys.exit(main(sys.argv[1:]))
sys.exit(run()) or simplified: sys.exit(sys.exit(main(sys.argv[1:]))) which is honestly quite a mess but honestly i don't know |
Didn't know that, then yes, your solution is better |
okay this is the best solution i think, thanks! |
Co-authored-by: Kevin Tindall <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for another contribution! I only had a few minor things to point out. Really I wanted to just smack that approve button because this new main script is nice.
@ItsDrike The green button is tempting me like the one ring. The precious. I wants it. |
thank you for your feedback, I have made changes in response to the addressable points. |
Thanks! |
happens during server startup, for example
Add ping() method to BedrockServer (viastatus().latency
)Add kind() abstract method to return a string representation of the server kind.status
andquery
, assuming this input is meant for humans.ping
and omit trailing space instatus
if no player sample.Do you also want tests for the CLI? It would serve as a good end-to-end test case.
Edit: fixes #301.