Compare commits
No commits in common. "d5a248733a21b2f5657044b2eb9ff27ae017c165" and "3d882625d28367251fec7293f0384a658717e6b0" have entirely different histories.
d5a248733a
...
3d882625d2
5 changed files with 376 additions and 388 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,5 +3,3 @@ site
|
|||
.venv
|
||||
.data
|
||||
__pycache__
|
||||
.mypy_cache/
|
||||
.ruff_cache/
|
||||
|
|
11
.vscode/settings.json
vendored
11
.vscode/settings.json
vendored
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"[python]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit"
|
||||
},
|
||||
|
@ -7,15 +8,5 @@
|
|||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features"
|
||||
},
|
||||
"editor.formatOnSave": true,
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/__pycache__": true,
|
||||
"**/.ruff_cache": true,
|
||||
"**/.mypy_cache": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ import aiohttp
|
|||
|
||||
async def get_status(host: str, port: int = 25565) -> tuple[bool, dict]:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(f"https://api.mcsrvstat.us/2/{host}:{port}") as response:
|
||||
response = await response.json() # noqa: PLW2901
|
||||
if response["online"]:
|
||||
async with session.get(f'https://api.mcsrvstat.us/2/{host}:{port}') as response:
|
||||
response = await response.json()
|
||||
if response['online']:
|
||||
return (True, response)
|
||||
return (False, response)
|
||||
|
|
|
@ -84,7 +84,7 @@ target-version = "py311"
|
|||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
|
||||
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
|
||||
# McCabe complexity (`C901`) by default.
|
||||
select = ["I", "N", "F", "W", "E", "G", "INP", "T20", "PLC", "PLE", "PLW", "PLR", "LOG"]
|
||||
select = ["I", "N", "F", "W", "E", "G", "INP", "T20", "PLC", "PLE", "PLW", "PLR"]
|
||||
ignore = ["PLR0912", "PLR0915", "PLR2004"]
|
||||
|
||||
# Allow fix for all enabled rules (when `--fix`) is provided.
|
||||
|
|
Loading…
Add table
Reference in a new issue