mirror of
https://github.com/snowykami/server-status-client.git
synced 2025-12-17 10:06:41 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d24926daeb | |||
| 80ee613746 | |||
| 851d1b0b7f | |||
| f12858a876 | |||
| a0c84037e8 | |||
| 25e137b6db | |||
| c9d6265b9c | |||
| 95667b454e | |||
| cd548f595e |
21
.github/workflows/pypi-publish.yml
vendored
Normal file
21
.github/workflows/pypi-publish.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
pypi-publish:
|
||||
name: upload release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: pdm-project/setup-pdm@v3
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
run: pdm publish
|
||||
@@ -32,7 +32,7 @@ _✨ 服务器状态 - 客户端 ✨_
|
||||
Debian系请使用pipx安装
|
||||
|
||||
```bash
|
||||
sudo apt install python3-pipx
|
||||
sudo apt install pipx
|
||||
pipx install server-status
|
||||
```
|
||||
|
||||
@@ -79,4 +79,8 @@ EOF'
|
||||
|
||||
sudo systemctl enable server-status-client
|
||||
sudo systemctl start server-status-client
|
||||
```
|
||||
```
|
||||
|
||||
### 服务端
|
||||
|
||||
请在中心服务器上部署 [server-status-server](https://github.com/snowykami/server-status-server)
|
||||
@@ -1,9 +1,9 @@
|
||||
[project]
|
||||
name = "server-status-cv-py"
|
||||
version = "0.1.0"
|
||||
name = "server-status"
|
||||
dynamic = ["version"]
|
||||
description = "Server status client"
|
||||
authors = [
|
||||
{name = "snowykami", email = "snowykami@outlook.com"},
|
||||
{ name = "snowykami", email = "snowykami@outlook.com" },
|
||||
]
|
||||
dependencies = [
|
||||
"requests>=2.32.3",
|
||||
@@ -12,12 +12,19 @@ dependencies = [
|
||||
]
|
||||
requires-python = ">=3.11"
|
||||
readme = "README.md"
|
||||
license = {text = "MIT"}
|
||||
license = { text = "MIT" }
|
||||
|
||||
[build-system]
|
||||
requires = ["pdm-backend"]
|
||||
build-backend = "pdm.backend"
|
||||
|
||||
[project.scripts]
|
||||
server-status = "server_status.__main__:main"
|
||||
|
||||
[tool.pdm]
|
||||
distribution = true
|
||||
|
||||
[tool.pdm.version]
|
||||
source = "scm"
|
||||
tag_filter = "v*"
|
||||
tag_regex = '^v(?:\D*)?(?P<version>([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|c|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$)$'
|
||||
@@ -106,17 +106,15 @@ class Api:
|
||||
"""
|
||||
self.headers.update(self.format(headers))
|
||||
|
||||
def format(self, obj: str | tuple[str, ...] | dict[str, Any]):
|
||||
def format(self, obj: str | list[str] | dict[str, Any]) -> str | list[str] | dict[str, Any]:
|
||||
if isinstance(obj, str):
|
||||
obj = obj.format(**self.variables)
|
||||
elif isinstance(obj, dict):
|
||||
for key in obj:
|
||||
obj[key] = self.format(obj[key])
|
||||
elif isinstance(obj, (list, tuple)):
|
||||
elif isinstance(obj, list):
|
||||
for i in range(len(obj)):
|
||||
obj[i] = self.format(obj[i])
|
||||
else:
|
||||
pass
|
||||
return obj
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user